feat : update module
Deskripsi: - update announcement and api - update position and api No Issue
This commit is contained in:
9
src/module/announcement/lib/api_announcement.ts
Normal file
9
src/module/announcement/lib/api_announcement.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const funGetAllAnnouncement = async (path?: string) => {
|
||||
const response = await fetch(`/api/announcement${(path) ? path : ''}`, { next: { tags: ['announcement'] } });
|
||||
return await response.json().catch(() => null);
|
||||
}
|
||||
|
||||
export const funGetAnnouncementById = async (path: string) => {
|
||||
const response = await fetch(`/api/announcement/${path}`);
|
||||
return await response.json().catch(() => null);
|
||||
}
|
||||
24
src/module/announcement/lib/type_announcement.ts
Normal file
24
src/module/announcement/lib/type_announcement.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export interface IListDataAnnouncement {
|
||||
id: string,
|
||||
title: string,
|
||||
desc: string,
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface IRootAllAnnouncement {
|
||||
announcement: IAnnouncement
|
||||
allAnnouncementMember: IAllAnnouncementMember[]
|
||||
}
|
||||
|
||||
export interface IAnnouncement {
|
||||
id: string
|
||||
title: string
|
||||
desc: string
|
||||
}
|
||||
|
||||
export interface IAllAnnouncementMember {
|
||||
idAnnouncement: string
|
||||
idGroup: string
|
||||
idDivision: string
|
||||
group: string
|
||||
}
|
||||
Reference in New Issue
Block a user