Skip to content

Commit 134a807

Browse files
fix: use type assertion to access createdAt and updatedAt fields (CAL-5406)
Co-Authored-By: [email protected] <[email protected]>
1 parent 800d782 commit 134a807

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

packages/trpc/server/routers/viewer/organizations/listMembers.handler.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,20 @@ export const listMembersHandler = async ({ ctx, input }: GetOptions) => {
246246
.format(membership.user.lastActiveAt)
247247
.toLowerCase()
248248
: null,
249-
createdAt: null,
250-
updatedAt: null,
249+
createdAt: (membership as any).createdAt
250+
? new Intl.DateTimeFormat(ctx.user.locale, {
251+
timeZone: ctx.user.timeZone,
252+
})
253+
.format((membership as any).createdAt)
254+
.toLowerCase()
255+
: null,
256+
updatedAt: (membership as any).updatedAt
257+
? new Intl.DateTimeFormat(ctx.user.locale, {
258+
timeZone: ctx.user.timeZone,
259+
})
260+
.format((membership as any).updatedAt)
261+
.toLowerCase()
262+
: null,
251263
avatarUrl: user.avatarUrl,
252264
teams: user.teams
253265
.filter((team) => team.team.id !== organizationId) // In this context we dont want to return the org team

0 commit comments

Comments
 (0)