We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83e2e14 commit b1cf882Copy full SHA for b1cf882
packages/api/services/collection/purchases/index.ts
@@ -27,6 +27,10 @@ export default ({ _socket }: UserServices) => ({
27
date: new Date(date),
28
description,
29
};
30
+ if (Number.isNaN(criteria.date.getTime())) {
31
+ return { error: `Invalid date: ${date}` } as const;
32
+ }
33
+
34
if (
35
(await prismaDm.purchase.count({
36
where: criteria,
0 commit comments