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
@@ -13,7 +13,7 @@ export const fromCreateRoleInputToFlatRoleToCreate = ({
|
||||
workspaceId: string;
|
||||
applicationId: string;
|
||||
}): FlatRole => {
|
||||
const now = new Date();
|
||||
const now = new Date().toISOString();
|
||||
|
||||
const {
|
||||
label,
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@ export const fromRoleEntityToFlatRole = (role: RoleEntity): FlatRole => {
|
||||
canBeAssignedToApiKeys: role.canBeAssignedToApiKeys,
|
||||
canBeAssignedToApplications: role.canBeAssignedToApplications,
|
||||
workspaceId: role.workspaceId,
|
||||
createdAt: role.createdAt,
|
||||
updatedAt: role.updatedAt,
|
||||
createdAt: role.createdAt.toISOString(),
|
||||
updatedAt: role.updatedAt.toISOString(),
|
||||
universalIdentifier: role.universalIdentifier ?? role.standardId ?? role.id,
|
||||
applicationId: role.applicationId ?? null,
|
||||
roleTargetIds: role.roleTargets.map((rt) => rt.id),
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ export const fromStandardRoleDefinitionToFlatRole = (
|
||||
standardRoleDefinition: StandardRoleDefinition,
|
||||
workspaceId: string,
|
||||
): FlatRole => {
|
||||
const createdAt = new Date();
|
||||
const createdAt = new Date().toISOString();
|
||||
|
||||
return {
|
||||
...standardRoleDefinition,
|
||||
|
||||
Reference in New Issue
Block a user