Fix flat entity maps date serialization (#16420)
Changes: - as we store date in redis as serialized, let's make all flatEntity dates as string. This requires changing FlatEntity types and making sure that entity are converted to flatEntity and flatEntity to dtos
This commit is contained in:
+2
@@ -44,6 +44,8 @@ export class WorkspaceFlatRouteTriggerMapCacheService extends WorkspaceCacheProv
|
||||
...removePropertiesFromRecord(routeTriggerEntity, [
|
||||
...ROUTE_TRIGGER_ENTITY_RELATION_PROPERTIES,
|
||||
]),
|
||||
createdAt: routeTriggerEntity.createdAt.toISOString(),
|
||||
updatedAt: routeTriggerEntity.updatedAt.toISOString(),
|
||||
universalIdentifier:
|
||||
routeTriggerEntity.universalIdentifier ?? routeTriggerEntity.id,
|
||||
} satisfies FlatRouteTrigger;
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@ export const fromCreateRouteTriggerInputToFlatRouteTrigger = ({
|
||||
httpMethod: createRouteTriggerInput.httpMethod,
|
||||
serverlessFunctionId: createRouteTriggerInput.serverlessFunctionId,
|
||||
workspaceId,
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
createdAt: now.toISOString(),
|
||||
updatedAt: now.toISOString(),
|
||||
applicationId: workspaceCustomApplicationId,
|
||||
};
|
||||
};
|
||||
|
||||
+1
-1
@@ -25,9 +25,9 @@ export const fromUpdateRouteTriggerInputToFlatRouteTriggerToUpdateOrThrow = ({
|
||||
|
||||
return {
|
||||
...existingFlatRouteTrigger,
|
||||
updatedAt: new Date().toISOString(),
|
||||
path: updateRouteTriggerInput.update.path,
|
||||
isAuthRequired: updateRouteTriggerInput.update.isAuthRequired,
|
||||
httpMethod: updateRouteTriggerInput.update.httpMethod,
|
||||
updatedAt: new Date(),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user