Skip to content

Commit

Permalink
feat: add message when there's no image
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardoSM committed Nov 27, 2023
1 parent c511299 commit 8634cdf
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions apps/app/pages/creators/images.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ function onInput(event: Event) {
async function uploadFile(file: File) {
loading.value = true;
const response = await creatorsStore.signUrl(file.type);
await uploadStore.uploadFileOnUrl(file, response.signedUrl.url);
await creatorsStore.addImage(response.signedUrl.fileName);
loading.value = false;
try {
const response = await creatorsStore.signUrl(file.type);
await uploadStore.uploadFileOnUrl(file, response.signedUrl.url);
await creatorsStore.addImage(response.signedUrl.fileName);
} finally {
loading.value = false;
}
}
</script>

Expand Down Expand Up @@ -98,5 +102,8 @@ async function uploadFile(file: File) {
:fileUrl="`https://menthor-content.s3.sa-east-1.amazonaws.com/${fileName}`"
/>
</div>
<div v-else class="text-center text-sm text-zinc-500 pt-10">
Você ainda não subiu nenhuma imagem.
</div>
</div>
</template>

0 comments on commit 8634cdf

Please sign in to comment.