feat: Admin/Items show only isActive #99

Merged
jsegarra merged 3 commits from admin_item_isActive into beta 2025-01-16 12:29:41 +00:00
2 changed files with 20 additions and 5 deletions

View File

@ -22,8 +22,8 @@ const query = `SELECT i.id, i.longName, i.size, i.category,
LEFT JOIN image im
ON im.collectionFk = 'catalog'
AND im.name = i.image
WHERE i.longName LIKE CONCAT('%', #search, '%')
OR i.id = #search
WHERE (i.longName LIKE CONCAT('%', #search, '%')
OR i.id = #search) AND i.isActive = 1
Review

Cambiar:

AND i.isActive = 1 → AND i.isActive

Cambiar: `AND i.isActive = 1 → AND i.isActive`
Review

Totalmente de acuerdo, porque esto es SQL tal cual, no es la utilidad web que se hizo para este proyecto

Totalmente de acuerdo, porque esto es SQL tal cual, no es la utilidad web que se hizo para este proyecto
Review

Fet!
85296109ca

Fet! https://gitea.verdnatura.es/verdnatura/hedera-web/commit/85296109caa8dc8b372d5f121a417c19319f2b8b
ORDER BY i.longName LIMIT 50`;
const onSearch = data => (items.value = data || []);

View File

@ -1,6 +1,5 @@
<script setup>
import { ref, onMounted, inject } from 'vue';
import VnImg from 'src/components/ui/VnImg.vue';
const jApi = inject('jApi');
const news = ref([]);
const showPreview = ref(false);
@ -14,6 +13,15 @@ const fetchData = async () => {
);
};
const showImagePreview = src => {
showPreview.value = true;
selectedImageSrc.value = src;
};
const hideImagePreview = src => {
showPreview.value = false;
selectedImageSrc.value = null;
};
onMounted(async () => await fetchData());
</script>
@ -22,7 +30,14 @@ onMounted(async () => await fetchData());
<div class="q-pa-sm row items-start">
<div class="new-card q-pa-sm" v-for="myNew in news" :key="myNew.id">
<QCard>
<VnImg :id="myNew.image" storage="news" />
<QImg
:src="`${$app.imageUrl}/news/full/${myNew.image}`"
@click="
showImagePreview(
`${$app.imageUrl}/news/full/${myNew.image}`
)
"
/>
<QCardSection>
<div class="text-h5">
@ -46,7 +61,7 @@ onMounted(async () => await fetchData());
>
</QPageSticky>
</div>
<QDialog v-model="showPreview" @hide="selectedImageSrc = ''">
<QDialog v-model="showPreview" @hide="hideImagePreview">
<QImg :src="selectedImageSrc" />
</QDialog>
</template>