Add image upload to s3

This commit is contained in:
2025-08-02 00:58:40 +02:00
parent 624bb7e124
commit 7d974a857c
8 changed files with 296 additions and 10 deletions
@@ -40,7 +40,24 @@ const uploading = ref(false);
async function submit() {
uploading.value = true;
// TODO: add upload logic
const body = new FormData();
if (data.value?.answer?.updatedAt) {
body.set('updatedAt', data.value?.answer?.updatedAt);
}
if (answer.value) {
body.set('answer', answer.value);
}
if (newImage.value) {
body.set('image', newImage.value);
}
const result = await $fetch(`/api/quest/${questSlug?.id}/submit`, {
method: 'POST',
body
});
console.log(result);
await refresh();
uploading.value = false;