feat : update dit calender

This commit is contained in:
lukman
2024-08-19 13:35:00 +08:00
parent 390e13544a
commit 3bb8233b3d
11 changed files with 467 additions and 20 deletions

View File

@@ -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);
}

View File

@@ -51,4 +51,34 @@ export interface IFormMemberCalender {
export interface IFormUlangiEvent {
id: string
}
export interface IEditCalender {
title?: string
dateStart?: String
timeStart?: string
timeEnd?: string
linkMeet?: string
repeatEventTyper?: string
desc?: string,
member?: IEditMemberCalender[]
}
export interface IEditMemberCalender {
idUser: {
id: string
name: string
}[]
}
export interface IDetailByIdCalender {
title?: string
desc?: string
timeStart?: string
dateStart?: string
timeEnd?: string
createdAt?: string
linkMeet?: string
repeatEventTyper?: string
}