完成博客、资源管理api

This commit is contained in:
2025-05-12 15:50:50 +08:00
parent b6e31933b3
commit 877fa54633
13 changed files with 99 additions and 3 deletions

View 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)
})
}