Skip to content

Commit 0d3a5c7

Browse files
committed
refactor(people): allow selectedProvider to be undefined and simplify date handling
1 parent 2efd754 commit 0d3a5c7

File tree

1 file changed

+3
-7
lines changed
  • apps/app/src/app/(app)/[orgId]/people/all/data

1 file changed

+3
-7
lines changed

apps/app/src/app/(app)/[orgId]/people/all/data/queries.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { serverApi } from '@/lib/server-api-client';
33
export interface EmployeeSyncConnectionsData {
44
googleWorkspaceConnectionId: string | null;
55
ripplingConnectionId: string | null;
6-
selectedProvider: 'google-workspace' | 'rippling' | null;
6+
selectedProvider: 'google-workspace' | 'rippling' | null | undefined;
77
lastSyncAt: Date | null;
88
nextSyncAt: Date | null;
99
}
@@ -49,11 +49,7 @@ export async function getEmployeeSyncConnections(
4949
? ripplingResponse.data.connectionId
5050
: null,
5151
selectedProvider: selectedProviderSlug,
52-
lastSyncAt: selectedConnection?.lastSyncAt
53-
? new Date(selectedConnection.lastSyncAt)
54-
: null,
55-
nextSyncAt: selectedConnection?.nextSyncAt
56-
? new Date(selectedConnection.nextSyncAt)
57-
: null,
52+
lastSyncAt: selectedConnection?.lastSyncAt ? new Date(selectedConnection.lastSyncAt) : null,
53+
nextSyncAt: selectedConnection?.nextSyncAt ? new Date(selectedConnection.nextSyncAt) : null,
5854
};
5955
}

0 commit comments

Comments
 (0)