From 10a967d69e1e3c8c391bdbaec1668350bddee58f Mon Sep 17 00:00:00 2001 From: MeowcaTheoRange Date: Thu, 24 Aug 2023 00:57:35 -0500 Subject: [PATCH] fix updatedDate discrepancy --- src/lib/trollcall/convert/troll.ts | 3 ++- src/types/troll.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/trollcall/convert/troll.ts b/src/lib/trollcall/convert/troll.ts index 7b59277..f0d92fb 100644 --- a/src/lib/trollcall/convert/troll.ts +++ b/src/lib/trollcall/convert/troll.ts @@ -17,7 +17,8 @@ export async function ServerTrollToClientTroll( : null, class: serverTroll.class ? Class[serverTroll.class] : null, owner: undefined, - flairs: undefined + flairs: undefined, + updatedDate: serverTroll.updatedDate?.getTime() }; return clientTroll; diff --git a/src/types/troll.ts b/src/types/troll.ts index b9be576..ae468bc 100644 --- a/src/types/troll.ts +++ b/src/types/troll.ts @@ -11,7 +11,7 @@ export const ServerTrollSchema = SubmitTrollSchema.shape({ owner: ObjectIdSchema.required(), flairs: yup.array().of(ObjectIdSchema.required()).required(), quirks: ServerQuirkHolderSchema.required(), - updatedDate: yup.date().notRequired() + updatedDate: yup.date() }); export type ServerTroll = WithId>; @@ -22,7 +22,8 @@ export const ClientTrollSchema = SubmitTrollSchema.shape({ quirks: ServerQuirkHolderSchema.required(), trueSign: TrueSignSchema.notRequired(), falseSign: TrueSignSchema.notRequired(), - class: ClassSchema.notRequired() + class: ClassSchema.notRequired(), + updatedDate: yup.number().notRequired() }); export interface ClientTroll extends yup.InferType {