Add, list, getbyid
working via zustand now + adding image from camera
This commit is contained in:
@@ -31,19 +31,17 @@ export async function createNotice(notice) {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
// console.log("Response", response.data, "status code: ", response.status);
|
||||
// console.log("New notice id: ", response.data.noticeId);
|
||||
// console.log("Image url: ", notice.image)
|
||||
|
||||
if (response.data.noticeId !== null) {
|
||||
notice.image.forEach(imageUri => {
|
||||
uploadImage(response.data.noticeId, imageUri);
|
||||
});
|
||||
// uploadImage(response.data.noticeId, notice.image);
|
||||
}
|
||||
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log("Error", error.response.data, error.response.status);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +85,6 @@ export async function getAllImagesByNoticeId(noticeId) {
|
||||
}
|
||||
|
||||
export const uploadImage = async (noticeId, imageUri) => {
|
||||
console.log("Started upload image");
|
||||
console.log(imageUri);
|
||||
|
||||
const formData = new FormData();
|
||||
|
||||
Reference in New Issue
Block a user