Skip to content

Commit

Permalink
fix: rwa dateTime resolvers now accepts empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
acaldas committed Sep 12, 2024
1 parent cc06f6b commit 2c76786
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/src/modules/real-world-assets/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ export const GroupTransactionType = enumType({
export const DateTime = scalarType({
name: 'DateTime',
serialize(value) {
return new Date(value as string).toISOString();
const date = utils.dateValidator.safeParse(value);
return date.data?.toISOString() || '';
},
parseValue(value) {
return utils.dateValidator.safeParse(value);
return utils.dateValidator.safeParse(value).data || '';
}
});

Expand Down

0 comments on commit 2c76786

Please sign in to comment.