refactor: remove accessToken from parameters in API requests for cleaner handling
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
import { HttpServer } from '~/libs/http-server'
|
||||
import { HttpServer, type THttpServer } from '~/libs/http-server'
|
||||
import type { TCategorySchema } from '~/pages/form-category'
|
||||
|
||||
const categoryResponseSchema = z.object({
|
||||
@@ -10,9 +10,8 @@ const categoryResponseSchema = z.object({
|
||||
})
|
||||
|
||||
type TParameters = {
|
||||
accessToken: string
|
||||
payload: TCategorySchema
|
||||
}
|
||||
} & THttpServer
|
||||
|
||||
export const updateCategoryRequest = async (parameters: TParameters) => {
|
||||
const { payload, ...restParameters } = parameters
|
||||
|
||||
Reference in New Issue
Block a user