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:
+1
-1
@@ -23,7 +23,7 @@ export const fromCreatePageLayoutWidgetInputToFlatPageLayoutWidgetToCreate = ({
|
||||
['pageLayoutTabId'],
|
||||
);
|
||||
|
||||
const createdAt = new Date();
|
||||
const createdAt = new Date().toISOString();
|
||||
const pageLayoutWidgetId = v4();
|
||||
|
||||
return {
|
||||
|
||||
+1
-1
@@ -36,6 +36,6 @@ export const fromDeletePageLayoutWidgetInputToFlatPageLayoutWidgetOrThrow = ({
|
||||
|
||||
return {
|
||||
...existingFlatPageLayoutWidgetToDelete,
|
||||
deletedAt: new Date(),
|
||||
deletedAt: new Date().toISOString(),
|
||||
};
|
||||
};
|
||||
|
||||
+3
@@ -14,6 +14,9 @@ export const fromPageLayoutWidgetEntityToFlatPageLayoutWidget = (
|
||||
|
||||
return {
|
||||
...pageLayoutWidgetEntityWithoutRelations,
|
||||
createdAt: pageLayoutWidgetEntity.createdAt.toISOString(),
|
||||
updatedAt: pageLayoutWidgetEntity.updatedAt.toISOString(),
|
||||
deletedAt: pageLayoutWidgetEntity.deletedAt?.toISOString() ?? null,
|
||||
universalIdentifier:
|
||||
pageLayoutWidgetEntityWithoutRelations.universalIdentifier ??
|
||||
pageLayoutWidgetEntityWithoutRelations.id,
|
||||
|
||||
Reference in New Issue
Block a user