完成博客权限修改

This commit is contained in:
2025-06-23 00:07:23 +08:00
parent ad0a152bd8
commit e9feb1f8ca
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) {