upd: home

Deskripsi:
- integrasi api kegiatan terupdate
- integrasi api divisi teraktif
- integrasi api progres kegiatan
- integrasi api jumlah dokumen
- integrasi api event hari ini
- integrasi api diskusi

No Issues
This commit is contained in:
amel
2025-04-28 16:37:01 +08:00
parent 32e260c8a4
commit a253adca35
10 changed files with 337 additions and 79 deletions

View File

@@ -31,10 +31,23 @@ export const apiGetBanner = async ({ user }: { user: string }) => {
};
// export const createEntity = async (newEntity: any) => {
// const response = await api.post('/entities', newEntity);
// return response.data;
// };
export const apiCreateBanner = async (data: FormData) => {
await api.post('/banner', data, {
headers: {
'Content-Type': 'multipart/form-data',
},
}).then(response => {
return response.data;
})
.catch(error => {
console.error('Error:', error);
});
};
export const apiGetDataHome = async ({ cat, user }: { cat: 'kegiatan' | 'division' | 'progress' | 'dokumen' | 'event' | 'discussion' | 'header' | 'check-late-project', user: string }) => {
const response = await api.get(`mobile/home?user=${user}&cat=${cat}`);
return response.data;
};
// export const updateEntityById = async (id: any, updatedEntity: any) => {
// const response = await api.put(`/entities/${id}`, updatedEntity);