Skip to content

Commit

Permalink
fix: delete image and images lag
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardoSM committed Jan 28, 2024
1 parent 5aadea0 commit 51fb6a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions apps/app/components/atoms/CreatorsImageCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defineEmits(["remove"]);
<template>
<div
v-if="fileUrl === 'loading'"
class="flex items-center justify-center w-full aspect-video bg-zinc-100 animate-pulse"
class="flex items-center justify-center w-full aspect-video bg-zinc-100"
>
<svg
class="w-10 h-10 text-zinc-200"
Expand Down Expand Up @@ -46,14 +46,12 @@ defineEmits(["remove"]);
</span>
</div>
<div class="aspect-video w-full overflow-hidden bg-zinc-100">
<nuxt-img
<img
:src="fileUrl"
:quality="85"
format="webp"
width="250"
height="140"
alt="Roadmap"
class="h-full w-full object-cover object-center transition-all group-hover:scale-110"
alt="Menthor image"
class="h-full w-full object-cover object-center"
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/app/pages/creators/images.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function removeImage(fileName: string) {
></div>
</div>
<div
class="grid grid-cols-[repeat(auto-fill,_minmax(200px,_1fr))] gap-1"
class="grid grid-cols-[repeat(auto-fill,_minmax(200px,_1fr))] gap-1 pb-20"
v-else-if="creatorsStore.images?.length > 0"
>
<CreatorsImageCard
Expand Down
2 changes: 1 addition & 1 deletion apps/app/stores/api/creators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const useCreatorsStore = defineStore("creators", {
},
async deleteImage(fileName: string) {
try {
await this.$api(`/creators/${fileName}`, {
await this.$api(`/creators/images/${fileName}`, {
method: "DELETE",
});

Expand Down

0 comments on commit 51fb6a8

Please sign in to comment.