fix: rename users id to users userId to easier availability sharing _get endpoint

This commit is contained in:
Agusti Fernandez Pardo committed 2022-06-16 00:18:40 +02:00
1 parent 4389288e69
commit 11f3d411b3
8 files changed
+30 -41

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { withValidation } from "next-validations";
import { z } from "zod";
import { baseApiParams } from "./baseApiParams";
// Extracted out as utility function so can be reused
// at different endpoints that require this validation.
export const schemaQueryUserId = baseApiParams
.extend({
userId: z
.string()
.regex(/^\d+$/)
.transform((id) => parseInt(id)),
})
.strict();