Merge pull request 'feat: Admin/Items show only isActive' (!99) from admin_item_isActive into beta
gitea/hedera-web/pipeline/head There was a failure building this commit Details

Reviewed-on: #99
This commit is contained in:
Javier Segarra 2025-01-16 12:29:41 +00:00
commit 5b15351844
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
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>