fix: rename users id to users userId to easier availability sharing _get endpoint
This commit is contained in:
1 parent
4389288e69
commit
11f3d411b3
8 files changed
+30
-41
No files matched your search
@@ -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();
|
||||
Reference in new issue
Block a user