upd: diskusi umum

Deskripsi:
- tambah diskusi umum
- list diskusi umum

No Issues
This commit is contained in:
amel
2025-01-03 16:15:51 +08:00
parent e8178438a3
commit ce8f22cc10
8 changed files with 610 additions and 103 deletions

View File

@@ -1,4 +1,17 @@
import { IFormMemberDisscussionGeneral } from "./type_discussion_general";
export const funGetAllDiscussionGeneral = async (path?: string) => {
const response = await fetch(`/api/discussion-general${(path) ? path : ''}`, { next: { tags: ['discussion-general'] } });
return await response.json().catch(() => null);
}
export const funCreateDiscussionGeneral = async (data: { idGroup: string, title: string, desc: string, member: IFormMemberDisscussionGeneral[] }) => {
const response = await fetch(`/api/discussion-general`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
return await response.json().catch(() => null);
}