feat : update dit calender
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IFormCreateCalender } from "./type_calender";
|
||||
import { IEditCalender, IFormCreateCalender } from "./type_calender";
|
||||
|
||||
export const funGetAllCalender = async (path?: string) => {
|
||||
const response = await fetch(`/api/calender${(path) ? path : ''}`, { next: { tags: ['calender'] } });
|
||||
@@ -26,4 +26,15 @@ export const funDeleteCalenderById = async (path: string) => {
|
||||
method: "DELETE",
|
||||
});
|
||||
return await response.json().catch(() => null);
|
||||
}
|
||||
|
||||
export const funEditCalenderById = async (path: string, data: IEditCalender) => {
|
||||
const response = await fetch(`/api/calender/${path}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
return await response.json().catch(() => null);
|
||||
}
|
||||
Reference in New Issue
Block a user