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);
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user