upd: upload gambar
Deskripsi: - upload gambar create banner - nb : susahhh, blm selesai No Issues
This commit is contained in:
10
lib/api.ts
10
lib/api.ts
@@ -32,16 +32,14 @@ export const apiGetBanner = async ({ user }: { user: string }) => {
|
||||
|
||||
|
||||
export const apiCreateBanner = async (data: FormData) => {
|
||||
await api.post('/banner', data, {
|
||||
console.log('jalan', data)
|
||||
const response = await api.post('mobile/banner', data, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
}).then(response => {
|
||||
return response.data;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
console.log('api',response.data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiGetDataHome = async ({ cat, user }: { cat: 'kegiatan' | 'division' | 'progress' | 'dokumen' | 'event' | 'discussion' | 'header' | 'check-late-project', user: string }) => {
|
||||
|
||||
Reference in New Issue
Block a user