完成博客权限修改

This commit is contained in:
2025-06-23 00:07:23 +08:00
parent a38463837f
commit edc605fb62
10 changed files with 178 additions and 2 deletions

View File

@@ -2,4 +2,5 @@ export * from './create';
export * from './remove';
export * from './list';
export * from './update';
export * from './get';
export * from './get';
export * from './setPassword';

View File

@@ -0,0 +1,10 @@
import fetcher from "@/lib/api/fetcher";
export async function setPassword(id: string, password: string) {
return fetcher<boolean>(`/api/admin/web/blog/${id}/password`, {
method: 'POST',
body: JSON.stringify({
password,
})
})
}

View File

@@ -1,9 +1,11 @@
import fetcher from "@/lib/api/fetcher";
import { BlogPermission } from "@/lib/types/Blog.Permission.enum";
type UpdateBlogParams = {
title: string;
description: string;
contentUrl: string;
permissions: BlogPermission[],
}
export async function update(id: string, data: UpdateBlogParams) {

View File

@@ -1,3 +1,5 @@
import { BlogPermission } from "./Blog.Permission.enum";
export interface Blog {
id: string;
title: string;
@@ -5,4 +7,5 @@ export interface Blog {
viewCount: number;
contentUrl: string;
createdAt: string;
permissions: BlogPermission[];
}