Add, list, getbyid

working via zustand now + adding image from camera
This commit is contained in:
2025-05-20 15:19:29 +02:00
parent 0295386dac
commit 532183b305
10 changed files with 1199 additions and 865 deletions

View File

@@ -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();