修复文件夹命名错误,添加命名空间
This commit is contained in:
19
tone-page-web/lib/api/admin/web/resource/create.ts
Normal file
19
tone-page-web/lib/api/admin/web/resource/create.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import fetcher from "@/lib/api/fetcher";
|
||||
|
||||
type CreateResourceParams = {
|
||||
title: string;
|
||||
description: string;
|
||||
imageUrl: string;
|
||||
link: string;
|
||||
tags: {
|
||||
name: string;
|
||||
type: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export async function create(data: CreateResourceParams) {
|
||||
return fetcher('/admin/web/resource', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
}
|
||||
4
tone-page-web/lib/api/admin/web/resource/index.ts
Normal file
4
tone-page-web/lib/api/admin/web/resource/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from './create';
|
||||
export * from './remove';
|
||||
export * from './list';
|
||||
export * from './update';
|
||||
5
tone-page-web/lib/api/admin/web/resource/list.ts
Normal file
5
tone-page-web/lib/api/admin/web/resource/list.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import fetcher from "@/lib/api/fetcher";
|
||||
|
||||
export async function list() {
|
||||
return fetcher('/admin/web/resource')
|
||||
}
|
||||
7
tone-page-web/lib/api/admin/web/resource/remove.ts
Normal file
7
tone-page-web/lib/api/admin/web/resource/remove.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import fetcher from "@/lib/api/fetcher";
|
||||
|
||||
export async function remove(id: string) {
|
||||
return fetcher(`/admin/web/resource/${id}`, {
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
19
tone-page-web/lib/api/admin/web/resource/update.ts
Normal file
19
tone-page-web/lib/api/admin/web/resource/update.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import fetcher from "@/lib/api/fetcher";
|
||||
|
||||
type UpdateResourceParams = {
|
||||
title: string;
|
||||
description: string;
|
||||
imageUrl: string;
|
||||
link: string;
|
||||
tags: {
|
||||
name: string;
|
||||
type: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export async function update(id: string, data: UpdateResourceParams) {
|
||||
return fetcher(`/admin/web/resource/${id}`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user