diff --git a/frontend/src/hooks/useViewSet.ts b/frontend/src/hooks/useViewSet.ts index 09b491b..988759f 100644 --- a/frontend/src/hooks/useViewSet.ts +++ b/frontend/src/hooks/useViewSet.ts @@ -11,7 +11,7 @@ export type ViewSetList = (config?: AxiosRequestConfig) => Promise = (pk: string, config?: AxiosRequestConfig) => Promise export type ViewSetCreate = (config?: AxiosRequestConfigWithData) => Promise export type ViewSetUpdate = (pk: string, config?: AxiosRequestConfigWithData) => Promise -export type ViewSetDestroy = (pk: string, config?: AxiosRequestConfig) => Promise +export type ViewSetDestroy = (pk: string, config?: AxiosRequestConfig) => Promise /** @@ -69,7 +69,7 @@ export interface ViewSet { * @param pk - The primary key of the resource to destroy. * @param config - Additional config parameters to use in the request. */ - destroy: ViewSetDestroy, + destroy: ViewSetDestroy, } @@ -143,12 +143,12 @@ export function useViewSet(baseRoute: string): ViewSet { [action, baseRoute] ) - const destroy: ViewSetDestroy = + const destroy: ViewSetDestroy = React.useCallback( async (pk, config) => { await action({...config, url: `${baseRoute}${pk}/`, method: "DELETE"}) }, - [action, baseRoute] + [action, baseRoute], ) return {command, action, list, retrieve, create, update, destroy}