chore: make apis nullable (#7763)
what: - makes top level attributes of each object an optional field in the http layer where possible RESOLVES CORE-2229
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { z } from "zod"
|
||||
import {
|
||||
createFindParams,
|
||||
createOperatorMap,
|
||||
createSelectParams,
|
||||
} from "../../utils/validators"
|
||||
import { z } from "zod"
|
||||
|
||||
export const AdminGetUserParams = createSelectParams()
|
||||
|
||||
@@ -18,23 +18,23 @@ export const AdminGetUsersParams = createFindParams({
|
||||
created_at: createOperatorMap().optional(),
|
||||
updated_at: createOperatorMap().optional(),
|
||||
deleted_at: createOperatorMap().optional(),
|
||||
email: z.string().optional(),
|
||||
first_name: z.string().optional(),
|
||||
last_name: z.string().optional(),
|
||||
email: z.string().nullish(),
|
||||
first_name: z.string().nullish(),
|
||||
last_name: z.string().nullish(),
|
||||
})
|
||||
)
|
||||
|
||||
export type AdminCreateUserType = z.infer<typeof AdminCreateUser>
|
||||
export const AdminCreateUser = z.object({
|
||||
email: z.string(),
|
||||
first_name: z.string().optional(),
|
||||
last_name: z.string().optional(),
|
||||
avatar_url: z.string().optional(),
|
||||
first_name: z.string().nullish(),
|
||||
last_name: z.string().nullish(),
|
||||
avatar_url: z.string().nullish(),
|
||||
})
|
||||
|
||||
export type AdminUpdateUserType = z.infer<typeof AdminUpdateUser>
|
||||
export const AdminUpdateUser = z.object({
|
||||
first_name: z.string().optional(),
|
||||
last_name: z.string().optional(),
|
||||
avatar_url: z.string().optional(),
|
||||
first_name: z.string().nullish(),
|
||||
last_name: z.string().nullish(),
|
||||
avatar_url: z.string().nullish(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user