Fix nacitani letu u eventu

This commit is contained in:
Michal Kváček
2023-12-12 23:54:19 +01:00
parent c8ea17c1ec
commit 9aebc352cd
4 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -16,9 +16,10 @@ ${FRAGMENT_FLIGHT_LIST_INFO}
`;
export const FLIGHTS_PUBLIC_LIST = gql`
query FlightsPublicList($username: String, $aircraftId: Int, $copilotId: Int, $pointOfInterestId: Int, $limit: Int!, $offset: Int) {
query FlightsPublicList($username: String, $eventId: Int, $aircraftId: Int, $copilotId: Int, $pointOfInterestId: Int, $limit: Int!, $offset: Int) {
flights(
username: $username,
eventId: $eventId,
aircraftId: $aircraftId,
copilotId: $copilotId,
pointOfInterestId: $pointOfInterestId,
@@ -43,7 +43,7 @@ useMeta(() => metaData({
const loadNextFlightsPage = (appendItems) => loadPage({
fetchFunc: useFlightsStore().fetchPublic,
filters: {username: props.pilot.publicUsername},
filters: {username: props.pilot.publicUsername, eventId: event.value.id},
appendItems
});
loadNextFlightsPage(false);
+2 -2
View File
@@ -49,10 +49,10 @@ export const useFlightsStore = defineStore('Flights', () => {
}
}).then(data => setItems(data, appendItems, flights, totalItemsCount));
const fetchPublic = ({username, aircraftId, copilotId, pointOfInterestId, offset, limit, appendItems}) => query({
const fetchPublic = ({username, eventId, aircraftId, copilotId, pointOfInterestId, offset, limit, appendItems}) => query({
isQueryRunning,
query: FLIGHTS_PUBLIC_LIST,
variables: {username, aircraftId, copilotId, pointOfInterestId, offset, limit}
variables: {username, eventId, aircraftId, copilotId, pointOfInterestId, offset, limit}
}).then(items => setItems(items, appendItems, flights, totalItemsCount));
const create = (input) => mutate({