upd: calender

Deskripsi:
- tambah anggota kalender dipisah aja jadinya

No Issues
This commit is contained in:
amel
2024-09-06 17:41:00 +08:00
parent b900428bb7
commit c436daf540
5 changed files with 179 additions and 129 deletions

View File

@@ -1,4 +1,4 @@
import { IEditCalender, IFormCreateCalender } from "./type_calender";
import { IEditCalender, IFormCreateCalender, IFormMemberCalenderNew } from "./type_calender";
export const funGetAllCalender = async (path?: string) => {
const response = await fetch(`/api/calender${(path) ? path : ''}`, { next: { tags: ['calender'] } });
@@ -47,4 +47,15 @@ export const funEditCalenderById = async (path: string, data: IEditCalender) =>
export const funGetIndicatorCalender = async (path?: string) => {
const response = await fetch(`/api/calender/indicator${(path) ? path : ''}`, { next: { tags: ['hostory'] } });
return await response.json().catch(() => null);
}
}
export const funAddMemberCalender = async (path: string, data: IFormMemberCalenderNew) => {
const response = await fetch(`/api/calender/${path}/member`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
return await response.json().catch(() => null);
};

View File

@@ -93,4 +93,9 @@ export interface IDetailByIdCalender {
createdAt?: string
linkMeet?: string
repeatEventTyper?: string
}
export interface IFormMemberCalenderNew {
idUser: string
name: string
}