refactor: remove accessToken from parameters in API requests for cleaner handling

This commit is contained in:
Ardeman
2025-03-09 10:36:38 +08:00
parent 9976626f97
commit bad5294030
6 changed files with 12 additions and 18 deletions
+2 -3
View File
@@ -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