完成资源CRUD
This commit is contained in:
6
tone-page-web/lib/api/admin/web/resource/get.ts
Normal file
6
tone-page-web/lib/api/admin/web/resource/get.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import fetcher from "@/lib/api/fetcher";
|
||||
import { Resource } from "@/lib/types/resource";
|
||||
|
||||
export async function get(id: string) {
|
||||
return fetcher<Resource>(`/api/admin/web/resource/${id}`)
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
export * from './create';
|
||||
export * from './remove';
|
||||
export * from './list';
|
||||
export * from './update';
|
||||
export * from './update';
|
||||
export * from './get';
|
||||
@@ -13,7 +13,7 @@ type UpdateResourceParams = {
|
||||
|
||||
export async function update(id: string, data: UpdateResourceParams) {
|
||||
return fetcher(`/api/admin/web/resource/${id}`, {
|
||||
method: 'POST',
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user