lepsi infinite scroll
This commit is contained in:
@@ -13,7 +13,6 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const config = computed(() => {
|
const config = computed(() => {
|
||||||
|
|
||||||
if (props.mode === "add") {
|
if (props.mode === "add") {
|
||||||
return {icon: "add", label: "Přidat"};
|
return {icon: "add", label: "Přidat"};
|
||||||
} else if (props.mode === "edit") {
|
} else if (props.mode === "edit") {
|
||||||
@@ -26,7 +25,11 @@ const config = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-page-sticky location="bottom" :offset="[30, 30]">
|
<q-page-sticky
|
||||||
|
location="bottom"
|
||||||
|
:offset="[30, 30]"
|
||||||
|
v-if="$q.screen.lt.md"
|
||||||
|
>
|
||||||
<q-fab :icon="config.icon" color="primary" :label="config.label" @click="$router.push(props.routerLink)"/>
|
<q-fab :icon="config.icon" color="primary" :label="config.label" @click="$router.push(props.routerLink)"/>
|
||||||
</q-page-sticky>
|
</q-page-sticky>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -38,14 +38,23 @@ onMounted(() => {
|
|||||||
|
|
||||||
if (search) {
|
if (search) {
|
||||||
filters.value.search = search;
|
filters.value.search = search;
|
||||||
|
} else {
|
||||||
|
filters.value = {};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<div class="flex">
|
||||||
|
<div class="col-grow">
|
||||||
<q-input v-model="filters.search" placeholder="Vyhledávání..." v-bind="commonProps" clearable>
|
<q-input v-model="filters.search" placeholder="Vyhledávání..." v-bind="commonProps" clearable>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<q-icon name="search"/>
|
<q-icon name="search"/>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center">
|
||||||
|
<slot name="append" class="full-height"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
const props = defineProps({
|
|
||||||
totalItemsCount: {
|
|
||||||
type: Number,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
itemsLength: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
itemsPerPage: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
default: 5,
|
|
||||||
},
|
|
||||||
isQueryRunning: {
|
|
||||||
type: Boolean,
|
|
||||||
required: false,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
const emits = defineEmits(["load-more"]);
|
|
||||||
const loadMore = () => {
|
|
||||||
emits("load-more", props.itemsPerPage);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<slot name="items"/>
|
|
||||||
<slot name="skeleton" v-if="isQueryRunning"/>
|
|
||||||
|
|
||||||
<div class="text-center q-my-md">
|
|
||||||
<q-btn color="primary" :loading="isQueryRunning" rounded size="lg" icon="expand_more" @click="loadMore()" v-if="totalItemsCount > itemsLength">
|
|
||||||
<slot name="loadMoreText"/>
|
|
||||||
</q-btn>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<script setup>
|
||||||
|
import {computed} from "vue";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
mode: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
routerLink: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const config = computed(() => {
|
||||||
|
if (props.mode === "add") {
|
||||||
|
return {icon: "add", label: "Přidat"};
|
||||||
|
} else if (props.mode === "edit") {
|
||||||
|
return {icon: "edit", label: "Upravit"};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {icon: "unknown", label: `Neznámý typ ${props.mode}`}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<q-toolbar class="justify-end q-pr-none" v-if="$q.screen.gt.sm">
|
||||||
|
<q-btn color="primary" size="lg" :icon="config.icon" :to="props.routerLink">{{ config.label }}</q-btn>
|
||||||
|
</q-toolbar>
|
||||||
|
|
||||||
|
<q-page-sticky
|
||||||
|
location="bottom"
|
||||||
|
:offset="[30, 30]"
|
||||||
|
v-else
|
||||||
|
>
|
||||||
|
<q-fab
|
||||||
|
:icon="config.icon"
|
||||||
|
color="primary"
|
||||||
|
:label="config.label"
|
||||||
|
@click="$router.push(props.routerLink)"
|
||||||
|
/>
|
||||||
|
</q-page-sticky>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
@@ -1,33 +1,24 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import LoadMoreList from "components/LoadMoreList.vue";
|
import {useInfiniteScroll} from "src/composables/pagination";
|
||||||
import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleton.vue";
|
|
||||||
import BasicListSkeleton from "components/basicSkeletons/BasicListSkeleton.vue";
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
items: {
|
items: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
totalItemsCount: {
|
...useInfiniteScroll().propsDef
|
||||||
type: Number,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
itemsPerPage: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
default: 5,
|
|
||||||
},
|
|
||||||
isQueryRunning: {
|
|
||||||
type: Boolean,
|
|
||||||
required: false,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const emits = defineEmits([...useInfiniteScroll().emitsDef])
|
||||||
|
const {emitLoadMore, hasMoreData} = useInfiniteScroll(emits, props)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<LoadMoreList :total-items-count="totalItemsCount" :items-length="items.length">
|
<q-infinite-scroll
|
||||||
<template #items>
|
:disable="!hasMoreData"
|
||||||
|
@load="emitLoadMore"
|
||||||
|
:offset="250"
|
||||||
|
>
|
||||||
<q-list bordered separator>
|
<q-list bordered separator>
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
@@ -57,12 +48,6 @@ const props = defineProps({
|
|||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
</template>
|
</q-infinite-scroll>
|
||||||
<template #skeleton>
|
|
||||||
<BasicListSkeleton :items="itemsPerPage"/>
|
|
||||||
</template>
|
|
||||||
<template #loadMoreText>
|
|
||||||
Další
|
|
||||||
</template>
|
|
||||||
</LoadMoreList>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,16 +1,27 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {formatDatetime} from "src/composables/datetimeUtils";
|
import {formatDatetime} from "src/composables/datetimeUtils";
|
||||||
|
import {useInfiniteScroll} from "src/composables/pagination";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
items: {
|
items: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
}
|
},
|
||||||
})
|
|
||||||
|
...useInfiniteScroll().propsDef
|
||||||
|
});
|
||||||
|
|
||||||
|
const emits = defineEmits([...useInfiniteScroll().emitsDef])
|
||||||
|
const {emitLoadMore, hasMoreData} = useInfiniteScroll(emits, props)
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<q-infinite-scroll
|
||||||
|
:disable="!hasMoreData"
|
||||||
|
@load="emitLoadMore"
|
||||||
|
:offset="250"
|
||||||
|
>
|
||||||
<q-list bordered separator>
|
<q-list bordered separator>
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
@@ -33,4 +44,5 @@ const props = defineProps({
|
|||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
|
</q-infinite-scroll>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
import {minutesToHumanReadable} from "src/composables/datetimeUtils";
|
import {minutesToHumanReadable} from "src/composables/datetimeUtils";
|
||||||
import {flightName} from "src/composables/flight";
|
import {flightName} from "src/composables/flight";
|
||||||
import AvatarFromPhoto from "components/avatars/AvatarFromPhoto.vue";
|
import AvatarFromPhoto from "components/avatars/AvatarFromPhoto.vue";
|
||||||
import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleton.vue";
|
import {useInfiniteScroll} from "src/composables/pagination";
|
||||||
import {computed} from "vue";
|
|
||||||
import LoadMoreList from "components/LoadMoreList.vue";
|
|
||||||
import {pluralize} from "../../composables/utils";
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
items: {
|
items: {
|
||||||
@@ -16,37 +13,26 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
totalItemsCount: {
|
...useInfiniteScroll().propsDef
|
||||||
type: Number,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
itemsPerPage: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
default: 5,
|
|
||||||
},
|
|
||||||
isQueryRunning: {
|
|
||||||
type: Boolean,
|
|
||||||
required: false,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const emits = defineEmits([...useInfiniteScroll().emitsDef])
|
||||||
|
const {emitLoadMore, hasMoreData} = useInfiniteScroll(emits, props)
|
||||||
|
|
||||||
const routeDetail = (flight) => {
|
const routeDetail = (flight) => {
|
||||||
if (props.public)
|
if (props.public)
|
||||||
return {name: "publicFlightDetail", params: {username: flight.pilot.publicUsername, flightSlug: flight.urlSlug}}
|
return {name: "publicFlightDetail", params: {username: flight.pilot.publicUsername, flightSlug: flight.urlSlug}}
|
||||||
else
|
else
|
||||||
return {name: "flightDetail", params: {id: flight.id}}
|
return {name: "flightDetail", params: {id: flight.id}}
|
||||||
};
|
};
|
||||||
const loadMoreCount = computed(() => {
|
|
||||||
return Math.min(props.itemsPerPage, props.totalItemsCount - props.items.length);
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<LoadMoreList :total-items-count="totalItemsCount" :items-length="items.length">
|
<q-infinite-scroll
|
||||||
<template #items>
|
:disable="!hasMoreData"
|
||||||
|
@load="emitLoadMore"
|
||||||
|
:offset="250"
|
||||||
|
>
|
||||||
<q-list bordered separator>
|
<q-list bordered separator>
|
||||||
<q-item
|
<q-item
|
||||||
v-for="flight of items" :key="flight"
|
v-for="flight of items" :key="flight"
|
||||||
@@ -99,13 +85,10 @@ const loadMoreCount = computed(() => {
|
|||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
|
<template v-slot:loading>
|
||||||
|
<div class="row justify-center q-my-md">
|
||||||
|
<q-spinner-dots color="primary" size="40px"/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #skeleton>
|
</q-infinite-scroll>
|
||||||
<FlightsListSkeleton :items="itemsPerPage"/>
|
|
||||||
</template>
|
|
||||||
<template #loadMoreText>
|
|
||||||
Načíst {{ pluralize(loadMoreCount, 'jeden let', `další ${loadMoreCount} lety`, `dalších ${loadMoreCount} letů`) }}
|
|
||||||
</template>
|
|
||||||
</LoadMoreList>
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import LoadMoreList from "components/LoadMoreList.vue";
|
import {useInfiniteScroll} from "src/composables/pagination";
|
||||||
import BasicListSkeleton from "components/basicSkeletons/BasicListSkeleton.vue";
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
items: {
|
items: {
|
||||||
@@ -11,20 +10,7 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
totalItemsCount: {
|
...useInfiniteScroll().propsDef,
|
||||||
type: Number,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
itemsPerPage: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
default: 5,
|
|
||||||
},
|
|
||||||
isQueryRunning: {
|
|
||||||
type: Boolean,
|
|
||||||
required: false,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const getRoute = (item) => {
|
const getRoute = (item) => {
|
||||||
@@ -33,10 +19,17 @@ const getRoute = (item) => {
|
|||||||
else
|
else
|
||||||
return {name: "poiDetail", params: {id: item.id}}
|
return {name: "poiDetail", params: {id: item.id}}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const emits = defineEmits(useInfiniteScroll().emitsDef)
|
||||||
|
const {emitLoadMore, hasMoreData} = useInfiniteScroll(emits, props)
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<LoadMoreList :total-items-count="totalItemsCount" :items-length="items.length">
|
<q-infinite-scroll
|
||||||
<template #items>
|
:disable="!hasMoreData"
|
||||||
|
@load="emitLoadMore"
|
||||||
|
:offset="250"
|
||||||
|
>
|
||||||
<q-list bordered separator>
|
<q-list bordered separator>
|
||||||
<q-item clickable v-for="poi of items" :key="poi" :to="getRoute(poi)">
|
<q-item clickable v-for="poi of items" :key="poi" :to="getRoute(poi)">
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
@@ -56,12 +49,5 @@ const getRoute = (item) => {
|
|||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
</template>
|
</q-infinite-scroll>
|
||||||
<template #skeleton>
|
|
||||||
<BasicListSkeleton :items="itemsPerPage"/>
|
|
||||||
</template>
|
|
||||||
<template #loadMoreText>
|
|
||||||
Další
|
|
||||||
</template>
|
|
||||||
</LoadMoreList>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {ref} from "vue";
|
import {computed, ref} from "vue";
|
||||||
|
|
||||||
|
|
||||||
export const usePagination = ({fetchFunction, itemsPerPage = 10}) => {
|
export const usePagination = ({fetchFunction, itemsPerPage = 10}) => {
|
||||||
@@ -9,19 +9,71 @@ export const usePagination = ({fetchFunction, itemsPerPage = 10}) => {
|
|||||||
const paginationLimit = ref(itemsPerPage);
|
const paginationLimit = ref(itemsPerPage);
|
||||||
const paginationOffset = ref(0);
|
const paginationOffset = ref(0);
|
||||||
const filters = ref({});
|
const filters = ref({});
|
||||||
|
const hasMoreData = ref(true)
|
||||||
|
|
||||||
const loadPage = (appendItems) => {
|
const loadFirstPage = () => {
|
||||||
|
paginationOffset.value = 0
|
||||||
return fetchFunction({
|
return fetchFunction({
|
||||||
...filters.value,
|
...filters.value,
|
||||||
limit: paginationLimit.value,
|
limit: paginationLimit.value,
|
||||||
offset: paginationOffset.value,
|
offset: 0,
|
||||||
appendItems
|
appendItems: false
|
||||||
}).then(() => {
|
}).then((data) => {
|
||||||
|
console.log("first page", data, data.length, paginationLimit.value)
|
||||||
paginationOffset.value += paginationLimit.value;
|
paginationOffset.value += paginationLimit.value;
|
||||||
|
hasMoreData.value = data.length === paginationLimit.value;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const loadPage = (index, done) => {
|
||||||
|
return fetchFunction({
|
||||||
|
...filters.value,
|
||||||
|
appendItems: true,
|
||||||
|
limit: paginationLimit.value,
|
||||||
|
offset: paginationOffset.value,
|
||||||
|
}).then((data) => {
|
||||||
|
console.log("load page", data, data.length, paginationOffset.value, paginationLimit.value)
|
||||||
|
|
||||||
|
paginationOffset.value += paginationLimit.value;
|
||||||
|
hasMoreData.value = data.length === paginationLimit.value;
|
||||||
|
if (done) done()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleFiltersChanged = (newFilters) => {
|
||||||
|
filters.value = newFilters;
|
||||||
|
loadFirstPage()
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
paginationOffset, paginationLimit, filters, loadPage
|
paginationOffset, paginationLimit, handleFiltersChanged, filters, loadPage, loadFirstPage, hasMoreData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const useLoading = (promiseGetter) => {
|
||||||
|
const loading = ref(false)
|
||||||
|
const load = () => {
|
||||||
|
loading.value = true
|
||||||
|
return promiseGetter().finally(() => loading.value = false)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {loading, load}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const useInfiniteScroll = (emits, props) => {
|
||||||
|
const emitsDef = ["load-more"]
|
||||||
|
const propsDef = {
|
||||||
|
hasMoreData: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const hasMoreData = computed(() => props.hasMoreData)
|
||||||
|
const emitLoadMore = (index, done) => emits("load-more", {index, done});
|
||||||
|
|
||||||
|
return {emitsDef, propsDef, hasMoreData, emitLoadMore}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ fragment flightFullInfo on Flight {
|
|||||||
durationMinCalculated
|
durationMinCalculated
|
||||||
isPublic
|
isPublic
|
||||||
flightPlanId
|
flightPlanId
|
||||||
|
|
||||||
socialImageUrl
|
socialImageUrl
|
||||||
titlePhoto {
|
titlePhoto {
|
||||||
thumbnailUrl
|
thumbnailUrl
|
||||||
|
|||||||
@@ -2,19 +2,17 @@ import gql from "graphql-tag";
|
|||||||
import {FRAGMENT_AIRCRAFT_FULL_INFO, FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO, FRAGMENT_AIRCRAFT_LIST_INFO} from "src/graphql/fragments/aircraft";
|
import {FRAGMENT_AIRCRAFT_FULL_INFO, FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO, FRAGMENT_AIRCRAFT_LIST_INFO} from "src/graphql/fragments/aircraft";
|
||||||
|
|
||||||
export const AIRCRAFTS_LIST = gql`
|
export const AIRCRAFTS_LIST = gql`
|
||||||
query AircraftsList ($limit: Int!, $offset: Int) {
|
query AircraftsList ($search: String, $limit: Int!, $offset: Int) {
|
||||||
aircrafts(limit: $limit, offset: $offset) {
|
aircrafts(search: $search, limit: $limit, offset: $offset) {
|
||||||
totalItemsCount
|
totalItemsCount
|
||||||
items {
|
items {
|
||||||
...aircraftListInfo
|
...aircraftListInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
${FRAGMENT_AIRCRAFT_LIST_INFO}
|
${FRAGMENT_AIRCRAFT_LIST_INFO}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
||||||
export const AIRCRAFT_DETAIL = gql`
|
export const AIRCRAFT_DETAIL = gql`
|
||||||
query AircraftDetail($id: Int!) {
|
query AircraftDetail($id: Int!) {
|
||||||
aircraft(id: $id) {
|
aircraft(id: $id) {
|
||||||
|
|||||||
@@ -2,13 +2,16 @@ import gql from "graphql-tag";
|
|||||||
import {FRAGMENT_FLIGHT_PLAN_FULL_INFO, FRAGMENT_FLIGHT_PLAN_LIST_INFO} from "src/graphql/fragments/flightPlan";
|
import {FRAGMENT_FLIGHT_PLAN_FULL_INFO, FRAGMENT_FLIGHT_PLAN_LIST_INFO} from "src/graphql/fragments/flightPlan";
|
||||||
|
|
||||||
export const FLIGHT_PLANS_LIST = gql`
|
export const FLIGHT_PLANS_LIST = gql`
|
||||||
query flightPlansList {
|
query flightPlansList($search: String, $limit: Int!, $offset: Int) {
|
||||||
flightPlans {
|
flightPlans(search: $search, limit: $limit, offset: $offset) {
|
||||||
|
totalItemsCount
|
||||||
|
items {
|
||||||
...flightPlanListInfo
|
...flightPlanListInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
${FRAGMENT_FLIGHT_PLAN_LIST_INFO}
|
${FRAGMENT_FLIGHT_PLAN_LIST_INFO}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const FLIGHT_PLAN_DETAIL = gql`
|
export const FLIGHT_PLAN_DETAIL = gql`
|
||||||
|
|||||||
@@ -5,12 +5,13 @@ import {FRAGMENT_PHOTO_FULL_INFO} from "src/graphql/fragments/photo";
|
|||||||
import {FRAGMENT_COPILOT_PUBLIC_INFO} from "src/graphql/fragments/copilot";
|
import {FRAGMENT_COPILOT_PUBLIC_INFO} from "src/graphql/fragments/copilot";
|
||||||
|
|
||||||
export const FLIGHTS_LIST = gql`
|
export const FLIGHTS_LIST = gql`
|
||||||
query FlightsList($eventId: Int, $aircraftId: Int, $copilotId: Int, $pointOfInterestId: Int, $limit: Int!, $offset: Int) {
|
query FlightsList($eventId: Int, $aircraftId: Int, $copilotId: Int, $pointOfInterestId: Int, $search: String, $limit: Int!, $offset: Int) {
|
||||||
flights(
|
flights(
|
||||||
eventId: $eventId,
|
eventId: $eventId,
|
||||||
aircraftId: $aircraftId,
|
aircraftId: $aircraftId,
|
||||||
copilotId: $copilotId,
|
copilotId: $copilotId,
|
||||||
pointOfInterestId: $pointOfInterestId,
|
pointOfInterestId: $pointOfInterestId,
|
||||||
|
search: $search,
|
||||||
limit: $limit,
|
limit: $limit,
|
||||||
offset: $offset
|
offset: $offset
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -1,31 +1,34 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import AircraftsList from "components/aircrafts/AircraftsList.vue";
|
import AircraftsList from "components/aircrafts/AircraftsList.vue";
|
||||||
import FAB from "components/FAB.vue";
|
|
||||||
import BasicListSkeleton from "components/basicSkeletons/BasicListSkeleton.vue";
|
import BasicListSkeleton from "components/basicSkeletons/BasicListSkeleton.vue";
|
||||||
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||||
import {useAircraftsStore} from "stores/Aircrafts";
|
import {useAircraftsStore} from "stores/Aircrafts";
|
||||||
import {storeToRefs} from "pinia";
|
import {storeToRefs} from "pinia";
|
||||||
import {useAppStore} from "stores/App";
|
import {useAppStore} from "stores/App";
|
||||||
import {usePagination} from "src/composables/pagination";
|
import {usePagination} from "src/composables/pagination";
|
||||||
import {onMounted} from "vue";
|
import ListFilters from "components/ListFilters.vue";
|
||||||
|
import PrimaryAction from "components/PrimaryAction.vue";
|
||||||
|
|
||||||
useAppStore().setPageTitle("Letadla");
|
useAppStore().setPageTitle("Letadla");
|
||||||
useAppStore().setBreadcrumbs([])
|
useAppStore().setBreadcrumbs([])
|
||||||
|
|
||||||
|
const {loadPage, hasMoreData, handleFiltersChanged} = usePagination({fetchFunction: useAircraftsStore().fetch});
|
||||||
const {aircrafts, totalItemsCount, isQueryRunning} = storeToRefs(useAircraftsStore());
|
const {aircrafts, totalItemsCount, isQueryRunning} = storeToRefs(useAircraftsStore());
|
||||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useAircraftsStore().fetch});
|
|
||||||
onMounted(() => {
|
|
||||||
loadPage(false);
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicListSkeleton :items="paginationLimit" v-if="isQueryRunning && !totalItemsCount"/>
|
<ListFilters @filters-changed="handleFiltersChanged">
|
||||||
|
<template #append>
|
||||||
|
<PrimaryAction mode="add" :router-link="{name: 'addAircraft'}"/>
|
||||||
|
</template>
|
||||||
|
</ListFilters>
|
||||||
|
|
||||||
|
<BasicListSkeleton :items="5" v-if="isQueryRunning && !totalItemsCount"/>
|
||||||
|
|
||||||
<BasicInfoBanner
|
<BasicInfoBanner
|
||||||
v-if="!isQueryRunning && totalItemsCount === 0"
|
v-if="!isQueryRunning && totalItemsCount === 0"
|
||||||
:route-add="{name: 'addAircraft'}"
|
:route-add="{name: 'addAircraft'}"
|
||||||
label-add="Vytvořit letadlo"
|
label-add="Přidat letadlo"
|
||||||
>
|
>
|
||||||
Aktuálně nemáš přidané žádné letadlo. Přidej se k existující organizaci nebo si sem ulož vlastní letadlo.
|
Aktuálně nemáš přidané žádné letadlo. Přidej se k existující organizaci nebo si sem ulož vlastní letadlo.
|
||||||
<br>
|
<br>
|
||||||
@@ -35,13 +38,8 @@ onMounted(() => {
|
|||||||
<AircraftsList
|
<AircraftsList
|
||||||
v-else
|
v-else
|
||||||
:items="aircrafts"
|
:items="aircrafts"
|
||||||
:total-items-count="totalItemsCount"
|
|
||||||
:is-query-running="isQueryRunning"
|
|
||||||
:items-per-page="paginationLimit"
|
|
||||||
:public="true"
|
:public="true"
|
||||||
class="q-mb-xl"
|
:has-more-data="hasMoreData"
|
||||||
@load-more="loadPage(true)"
|
@load-more="loadPage($event.index, $event.done)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FAB mode="add" :router-link="{name: 'addAircraft'}"/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,29 +1,32 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import FlightsList from "components/flights/FlightsList.vue";
|
import FlightsList from "components/flights/FlightsList.vue";
|
||||||
import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleton.vue";
|
import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleton.vue";
|
||||||
import FAB from "components/FAB.vue";
|
|
||||||
import {useAppStore} from "stores/App";
|
import {useAppStore} from "stores/App";
|
||||||
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||||
import {useFlightsStore} from "stores/Flights";
|
import {useFlightsStore} from "stores/Flights";
|
||||||
import {storeToRefs} from "pinia";
|
import {storeToRefs} from "pinia";
|
||||||
import {usePagination} from "src/composables/pagination";
|
import {usePagination} from "src/composables/pagination";
|
||||||
import {onMounted} from "vue";
|
import PrimaryAction from "components/PrimaryAction.vue";
|
||||||
|
import ListFilters from "components/ListFilters.vue";
|
||||||
|
|
||||||
useAppStore().setPageTitle("Moje lety");
|
useAppStore().setPageTitle("Moje lety");
|
||||||
useAppStore().setBreadcrumbs([]);
|
useAppStore().setBreadcrumbs([]);
|
||||||
|
|
||||||
const {loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
const {loadPage, hasMoreData, handleFiltersChanged} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||||
onMounted(() => {
|
const {flights, isQueryRunning} = storeToRefs(useFlightsStore());
|
||||||
loadPage(false);
|
|
||||||
});
|
|
||||||
const {flights, totalItemsCount, isQueryRunning} = storeToRefs(useFlightsStore());
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<ListFilters @filters-changed="handleFiltersChanged">
|
||||||
|
<template #append>
|
||||||
|
<PrimaryAction mode="add" :router-link="{name: 'addFlight'}"/>
|
||||||
|
</template>
|
||||||
|
</ListFilters>
|
||||||
|
|
||||||
<FlightsListSkeleton v-if="isQueryRunning && flights.length === 0"/>
|
<FlightsListSkeleton v-if="isQueryRunning && flights.length === 0"/>
|
||||||
|
|
||||||
<BasicInfoBanner
|
<BasicInfoBanner
|
||||||
v-else-if="!isQueryRunning && totalItemsCount === 0"
|
v-else-if="!isQueryRunning && flights.length === 0"
|
||||||
:route-add="{name: 'addFlight'}"
|
:route-add="{name: 'addFlight'}"
|
||||||
label-add="Přidat let"
|
label-add="Přidat let"
|
||||||
>
|
>
|
||||||
@@ -34,11 +37,7 @@ const {flights, totalItemsCount, isQueryRunning} = storeToRefs(useFlightsStore()
|
|||||||
v-else
|
v-else
|
||||||
:items="flights"
|
:items="flights"
|
||||||
:public="false"
|
:public="false"
|
||||||
:is-query-running="isQueryRunning"
|
:has-more-data="hasMoreData"
|
||||||
:items-per-page="paginationLimit"
|
@load-more="loadPage($event.index, $event.done)"
|
||||||
:total-items-count="totalItemsCount"
|
|
||||||
@load-more="loadPage(true)"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FAB mode="add" :router-link="{name: 'addFlight'}"/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {useFlightPlansStore} from "stores/FlightPlans";
|
import {useFlightPlansStore} from "stores/FlightPlans";
|
||||||
import {storeToRefs} from "pinia";
|
import {storeToRefs} from "pinia";
|
||||||
import {onMounted} from "vue";
|
|
||||||
import {useAppStore} from "stores/App";
|
import {useAppStore} from "stores/App";
|
||||||
import BasicListSkeleton from "components/basicSkeletons/BasicListSkeleton.vue";
|
import BasicListSkeleton from "components/basicSkeletons/BasicListSkeleton.vue";
|
||||||
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||||
import FAB from "components/FAB.vue";
|
|
||||||
import FlightPlansList from "components/flightPlans/FlightPlansList.vue";
|
import FlightPlansList from "components/flightPlans/FlightPlansList.vue";
|
||||||
|
import ListFilters from "components/ListFilters.vue";
|
||||||
|
import PrimaryAction from "components/PrimaryAction.vue";
|
||||||
|
import {usePagination} from "src/composables/pagination";
|
||||||
|
|
||||||
useAppStore().setPageTitle("Nový plán");
|
useAppStore().setPageTitle("Nový plán");
|
||||||
useAppStore().setBreadcrumbs([
|
useAppStore().setBreadcrumbs([
|
||||||
@@ -14,14 +15,20 @@ useAppStore().setBreadcrumbs([
|
|||||||
{label: "Plánované lety"},
|
{label: "Plánované lety"},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
onMounted(() => {
|
const {loadPage, hasMoreData, handleFiltersChanged} = usePagination({
|
||||||
useFlightPlansStore().fetch();
|
fetchFunction: useFlightPlansStore().fetch,
|
||||||
|
itemsPerPage: 20
|
||||||
});
|
});
|
||||||
|
|
||||||
const {flightPlans, isQueryRunning} = storeToRefs(useFlightPlansStore());
|
const {flightPlans, isQueryRunning} = storeToRefs(useFlightPlansStore());
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<ListFilters @filters-changed="handleFiltersChanged">
|
||||||
|
<template #append>
|
||||||
|
<PrimaryAction mode="add" :router-link="{name: 'newFlightPlan'}"/>
|
||||||
|
</template>
|
||||||
|
</ListFilters>
|
||||||
|
|
||||||
<BasicListSkeleton :items=5 v-if="isQueryRunning || !flightPlans"/>
|
<BasicListSkeleton :items=5 v-if="isQueryRunning || !flightPlans"/>
|
||||||
|
|
||||||
<BasicInfoBanner
|
<BasicInfoBanner
|
||||||
@@ -31,6 +38,10 @@ const {flightPlans, isQueryRunning} = storeToRefs(useFlightPlansStore());
|
|||||||
Aktuálně nemáš žádné naplánované lety.
|
Aktuálně nemáš žádné naplánované lety.
|
||||||
</BasicInfoBanner>
|
</BasicInfoBanner>
|
||||||
|
|
||||||
<FlightPlansList :items="flightPlans" v-else/>
|
<FlightPlansList
|
||||||
<FAB :router-link="{name: 'newFlightPlan'}" mode="add"/>
|
v-else
|
||||||
|
:items="flightPlans"
|
||||||
|
:has-more-data="hasMoreData"
|
||||||
|
@load-more="loadPage($event.index, $event.done)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -9,27 +9,25 @@ import {storeToRefs} from "pinia";
|
|||||||
import {usePagination} from "src/composables/pagination";
|
import {usePagination} from "src/composables/pagination";
|
||||||
import ListFilters from "components/ListFilters.vue";
|
import ListFilters from "components/ListFilters.vue";
|
||||||
import {onMounted} from "vue";
|
import {onMounted} from "vue";
|
||||||
|
import PrimaryAction from "components/PrimaryAction.vue";
|
||||||
|
|
||||||
useAppStore().setPageTitle("Zajímavá místa");
|
useAppStore().setPageTitle("Zajímavá místa");
|
||||||
useAppStore().setBreadcrumbs([]);
|
useAppStore().setBreadcrumbs([]);
|
||||||
|
|
||||||
const {filters, loadPage, paginationLimit, paginationOffset} = usePagination({
|
const {loadPage, hasMoreData, handleFiltersChanged} = usePagination({
|
||||||
fetchFunction: usePointsOfInterestStore().fetch
|
fetchFunction: usePointsOfInterestStore().fetch,
|
||||||
|
itemsPerPage: 20
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
|
||||||
loadPage(false);
|
|
||||||
})
|
|
||||||
const handleFiltersChanged = (newFilters) => {
|
|
||||||
paginationOffset.value = 0;
|
|
||||||
filters.value = newFilters;
|
|
||||||
loadPage(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
const {isQueryRunning, totalItemsCount, pointsOfInterest} = storeToRefs(usePointsOfInterestStore());
|
const {isQueryRunning, pointsOfInterest} = storeToRefs(usePointsOfInterestStore());
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ListFilters @filters-changed="handleFiltersChanged"/>
|
<ListFilters @filters-changed="handleFiltersChanged">
|
||||||
|
<template #append>
|
||||||
|
<PrimaryAction mode="add" :router-link="{name: 'addPOI'}"/>
|
||||||
|
</template>
|
||||||
|
</ListFilters>
|
||||||
|
|
||||||
<BasicListSkeleton :items="10" v-if="isQueryRunning && !pointsOfInterest.length"/>
|
<BasicListSkeleton :items="10" v-if="isQueryRunning && !pointsOfInterest.length"/>
|
||||||
<BasicInfoBanner
|
<BasicInfoBanner
|
||||||
@@ -45,10 +43,7 @@ const {isQueryRunning, totalItemsCount, pointsOfInterest} = storeToRefs(usePoint
|
|||||||
v-else
|
v-else
|
||||||
:public="false"
|
:public="false"
|
||||||
:items="pointsOfInterest"
|
:items="pointsOfInterest"
|
||||||
:total-items-count="totalItemsCount"
|
:has-more-data="hasMoreData"
|
||||||
:is-query-running="isQueryRunning"
|
@load-more="loadPage($event.index, $event.done)"
|
||||||
:items-per-page="paginationLimit"
|
|
||||||
@load-more="loadPage(true)"
|
|
||||||
/>
|
/>
|
||||||
<FAB :router-link="{name: 'addPOI'}" mode="add"/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -17,21 +17,11 @@ useMeta(() => metaData({
|
|||||||
title: "Místa"
|
title: "Místa"
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const {filters, loadPage, paginationOffset, paginationLimit} = usePagination({
|
const {loadPage, paginationLimit, hasMoreData, handleFiltersChanged} = usePagination({
|
||||||
fetchFunction: usePointsOfInterestStore().fetchPublic
|
fetchFunction: usePointsOfInterestStore().fetchPublic
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
const {pointsOfInterest, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
|
||||||
loadPage(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleFiltersChanged = (newFilters) => {
|
|
||||||
paginationOffset.value = 0;
|
|
||||||
filters.value = newFilters;
|
|
||||||
loadPage(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
const {pointsOfInterest, totalItemsCount, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -43,10 +33,8 @@ const {pointsOfInterest, totalItemsCount, isQueryRunning} = storeToRefs(usePoint
|
|||||||
v-else
|
v-else
|
||||||
:public="true"
|
:public="true"
|
||||||
:items="pointsOfInterest"
|
:items="pointsOfInterest"
|
||||||
:total-items-count="totalItemsCount"
|
:has-more-data="hasMoreData"
|
||||||
:is-query-running="isQueryRunning"
|
@load-more="loadPage($event.index, $event.done)"
|
||||||
:items-per-page="paginationLimit"
|
|
||||||
@load-more="loadPage(true)"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ export const useAircraftsStore = defineStore('Aircrafts', () => {
|
|||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetch = ({appendItems, limit = 100, offset = 0}) => query({
|
const fetch = ({search, appendItems, limit = 100, offset = 0}) => query({
|
||||||
isQueryRunning,
|
isQueryRunning,
|
||||||
query: AIRCRAFTS_LIST,
|
query: AIRCRAFTS_LIST,
|
||||||
variables: {limit, offset}
|
variables: {search, limit, offset}
|
||||||
}).then(data => setItems(data, appendItems, aircrafts, totalItemsCount));
|
}).then(data => setItems(data, appendItems, aircrafts, totalItemsCount));
|
||||||
|
|
||||||
const create = (input) => mutate({
|
const create = (input) => mutate({
|
||||||
isMutationRunning,
|
isMutationRunning,
|
||||||
@@ -41,6 +41,7 @@ export const useAircraftsStore = defineStore('Aircrafts', () => {
|
|||||||
variables: {input}
|
variables: {input}
|
||||||
}).then(item => {
|
}).then(item => {
|
||||||
aircrafts.value.push(item);
|
aircrafts.value.push(item);
|
||||||
|
totalItemsCount.value++;
|
||||||
return item;
|
return item;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {defineStore} from 'pinia'
|
import {defineStore} from 'pinia'
|
||||||
import {FLIGHT_PLAN_DETAIL, FLIGHT_PLANS_LIST} from "src/graphql/queries/flightPlan";
|
import {FLIGHT_PLAN_DETAIL, FLIGHT_PLANS_LIST} from "src/graphql/queries/flightPlan";
|
||||||
import {CREATE_FLIGHT_PLAN, EDIT_FLIGHT_PLAN} from "src/graphql/mutations/flightPlan";
|
import {CREATE_FLIGHT_PLAN, EDIT_FLIGHT_PLAN} from "src/graphql/mutations/flightPlan";
|
||||||
import {mutate, query, updateInItems} from "stores/helpers";
|
import {mutate, query, setItems, updateInItems} from "stores/helpers";
|
||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
|
|
||||||
export const useFlightPlansStore = defineStore('FlightPlans', () => {
|
export const useFlightPlansStore = defineStore('FlightPlans', () => {
|
||||||
@@ -9,6 +9,7 @@ export const useFlightPlansStore = defineStore('FlightPlans', () => {
|
|||||||
const flightPlans = ref([]);
|
const flightPlans = ref([]);
|
||||||
const isMutationRunning = ref(false);
|
const isMutationRunning = ref(false);
|
||||||
const isQueryRunning = ref(false);
|
const isQueryRunning = ref(false);
|
||||||
|
const totalItemsCount = ref(0);
|
||||||
|
|
||||||
const fetchDetail = (id) => {
|
const fetchDetail = (id) => {
|
||||||
return query({
|
return query({
|
||||||
@@ -26,12 +27,12 @@ export const useFlightPlansStore = defineStore('FlightPlans', () => {
|
|||||||
}).then(item => flightPlan.value = item);
|
}).then(item => flightPlan.value = item);
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetch = () => {
|
const fetch = ({search, appendItems, offset, limit}) => query({
|
||||||
return query({
|
|
||||||
isQueryRunning,
|
isQueryRunning,
|
||||||
query: FLIGHT_PLANS_LIST,
|
query: FLIGHT_PLANS_LIST,
|
||||||
}).then(items => flightPlans.value = items);
|
variables: {search, limit, offset}
|
||||||
}
|
}).then(data => setItems(data, appendItems, flightPlans, totalItemsCount));
|
||||||
|
|
||||||
|
|
||||||
const create = (input) => {
|
const create = (input) => {
|
||||||
return mutate({
|
return mutate({
|
||||||
@@ -40,6 +41,7 @@ export const useFlightPlansStore = defineStore('FlightPlans', () => {
|
|||||||
variables: {input},
|
variables: {input},
|
||||||
}).then(item => {
|
}).then(item => {
|
||||||
flightPlans.value.push(item);
|
flightPlans.value.push(item);
|
||||||
|
totalItemsCount.value++;
|
||||||
return item;
|
return item;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,11 +37,13 @@ export const useFlightsStore = defineStore('Flights', () => {
|
|||||||
pointOfInterestId,
|
pointOfInterestId,
|
||||||
offset,
|
offset,
|
||||||
limit,
|
limit,
|
||||||
|
search,
|
||||||
appendItems
|
appendItems
|
||||||
}) => query({
|
}) => query({
|
||||||
isQueryRunning,
|
isQueryRunning,
|
||||||
query: FLIGHTS_LIST,
|
query: FLIGHTS_LIST,
|
||||||
variables: {
|
variables: {
|
||||||
|
search,
|
||||||
eventId,
|
eventId,
|
||||||
aircraftId,
|
aircraftId,
|
||||||
copilotId,
|
copilotId,
|
||||||
@@ -63,6 +65,7 @@ export const useFlightsStore = defineStore('Flights', () => {
|
|||||||
variables: {input},
|
variables: {input},
|
||||||
}).then(item => {
|
}).then(item => {
|
||||||
flights.value.push(item);
|
flights.value.push(item);
|
||||||
|
totalItemsCount.value++;
|
||||||
return item;
|
return item;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export const usePointsOfInterestStore = defineStore('PointsOfInterest', () => {
|
|||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetch = ({limit = 100, offset = 0, appendItems, search = undefined}) => query({
|
const fetch = ({limit, offset, appendItems, search = undefined}) => query({
|
||||||
isQueryRunning,
|
isQueryRunning,
|
||||||
query: POI_LIST,
|
query: POI_LIST,
|
||||||
variables: {limit, offset, search}
|
variables: {limit, offset, search}
|
||||||
|
|||||||
Reference in New Issue
Block a user