From 7f33a44d94b792cfb88dd500f11e74eab95dc705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Mon, 15 Nov 2021 09:22:31 +0100 Subject: [PATCH] [chore] add serverside sorting for pricelist. fix public viewing --- src/api.d.ts | 2 +- src/components/CalculationTable.vue | 2 +- .../CalculationTable/DrinkPriceVolumes.vue | 12 +++- src/components/Pricelist.vue | 22 +++--- src/store.ts | 67 ++++++++++--------- 5 files changed, 62 insertions(+), 43 deletions(-) diff --git a/src/api.d.ts b/src/api.d.ts index 30d0e7d..32cf796 100644 --- a/src/api.d.ts +++ b/src/api.d.ts @@ -23,7 +23,7 @@ declare namespace FG { interface DrinkPrice { id: number; price: number; - volume: Array + volume: Array; public: boolean; description?: string; } diff --git a/src/components/CalculationTable.vue b/src/components/CalculationTable.vue index 4cb6094..24d7587 100644 --- a/src/components/CalculationTable.vue +++ b/src/components/CalculationTable.vue @@ -414,7 +414,7 @@ export default defineComponent({ console.log('result', result.count); if (result.count) pagination.value.rowsNumber = result.count; } catch (error) { - console.warn(error) + console.warn(error); } loading.value = false; } diff --git a/src/components/CalculationTable/DrinkPriceVolumes.vue b/src/components/CalculationTable/DrinkPriceVolumes.vue index 7ad9aa2..af8bf88 100644 --- a/src/components/CalculationTable/DrinkPriceVolumes.vue +++ b/src/components/CalculationTable/DrinkPriceVolumes.vue @@ -43,7 +43,7 @@
-
+
{ if (volumes.value) { const this_volume = volumes.value.find((a) => a.id === volume.value); @@ -328,6 +337,7 @@ export default defineComponent({ isUnderMinPrice, hasPermission, PERMISSIONS, + isPublic, }; }, }); diff --git a/src/components/Pricelist.vue b/src/components/Pricelist.vue index ab82a30..dfd80f4 100644 --- a/src/components/Pricelist.vue +++ b/src/components/Pricelist.vue @@ -10,7 +10,7 @@ :fullscreen="fullscreen" @request="onRequest" > -