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` 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( flights(
username: $username, username: $username,
eventId: $eventId,
aircraftId: $aircraftId, aircraftId: $aircraftId,
copilotId: $copilotId, copilotId: $copilotId,
pointOfInterestId: $pointOfInterestId, pointOfInterestId: $pointOfInterestId,
@@ -43,7 +43,7 @@ useMeta(() => metaData({
const loadNextFlightsPage = (appendItems) => loadPage({ const loadNextFlightsPage = (appendItems) => loadPage({
fetchFunc: useFlightsStore().fetchPublic, fetchFunc: useFlightsStore().fetchPublic,
filters: {username: props.pilot.publicUsername}, filters: {username: props.pilot.publicUsername, eventId: event.value.id},
appendItems appendItems
}); });
loadNextFlightsPage(false); loadNextFlightsPage(false);
+2 -2
View File
@@ -49,10 +49,10 @@ export const useFlightsStore = defineStore('Flights', () => {
} }
}).then(data => setItems(data, appendItems, flights, totalItemsCount)); }).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, isQueryRunning,
query: FLIGHTS_PUBLIC_LIST, 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)); }).then(items => setItems(items, appendItems, flights, totalItemsCount));
const create = (input) => mutate({ const create = (input) => mutate({