19 lines
412 B
TypeScript
19 lines
412 B
TypeScript
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)
|
|
})
|
|
} |