[fix] set rowsNumber after load side

This commit is contained in:
Tim Gröger 2021-11-13 15:53:30 +01:00
parent f5c6bcff6f
commit ed0c74b031
1 changed files with 6 additions and 5 deletions

View File

@ -169,7 +169,7 @@
<script lang="ts">
import DrinkPriceVolumes from '../components/CalculationTable/DrinkPriceVolumes.vue';
import { defineComponent, onMounted, ComputedRef, computed, ref } from 'vue';
import { defineComponent, onBeforeMount, ComputedRef, computed, ref } from 'vue';
import { Drink, usePricelistStore, DrinkPriceVolume } from '../store';
import MinPriceSetting from '../components/MinPriceSetting.vue';
import { api, hasPermission } from '@flaschengeist/api';
@ -206,7 +206,7 @@ export default defineComponent({
setup(props) {
const store = usePricelistStore();
onMounted(() => {
onBeforeMount(() => {
//void store.getDrinks();
onRequest({
pagination: pagination.value,
@ -404,16 +404,17 @@ export default defineComponent({
offset: startRow,
limit: fetchCount,
descending,
search_name: props.filter.value,
search_key: props.filter.key,
search_name: props.filter?.value,
search_key: props.filter?.key,
});
pagination.value.page = page;
pagination.value.rowsPerPage = rowsPerPage;
pagination.value.sortBy = sortBy;
pagination.value.descending = descending;
console.log('result', result.count);
if (result.count) pagination.value.rowsNumber = result.count;
} catch (error) {
//..
console.warn(error)
}
loading.value = false;
}