feat: transform registration payload to include subscription plan ID and update select options
This commit is contained in:
@@ -11,7 +11,15 @@ const loginResponseSchema = z.object({
|
||||
|
||||
export const newsRegisterRequest = async (payload: TRegisterSchema) => {
|
||||
try {
|
||||
const { data } = await HttpServer().post('/api/user/register', payload)
|
||||
const { subscription, ...restPayload } = payload
|
||||
const transformedPayload = {
|
||||
...restPayload,
|
||||
subscribe_plan_id: subscription,
|
||||
}
|
||||
const { data } = await HttpServer().post(
|
||||
'/api/user/register',
|
||||
transformedPayload,
|
||||
)
|
||||
return loginResponseSchema.parse(data)
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line unicorn/no-useless-promise-resolve-reject
|
||||
|
||||
Reference in New Issue
Block a user