Homepage, verejna cast, vetsi sada uprav a oprav

This commit is contained in:
Michal Kváček
2023-08-21 22:45:58 +02:00
parent 8bc477a611
commit 8c3b8d19dd
54 changed files with 550 additions and 372 deletions
+7 -4
View File
@@ -36,20 +36,23 @@ export const useFlightsStore = defineStore('Flights', {
return flight;
});
},
fetchDetail(id, username) {
fetchDetail(id, username = null) {
if (typeof id !== "number") {
id = parseInt(id);
}
return apolloWrapper.query(FLIGHT_DETAIL, {id, username}).then(result => result.data.flight);
},
fetch(username) {
fetch(username = null) {
return apolloWrapper
.query(FLIGHTS_LIST, {username})
.then(({data}) => {
.then((resp) => {
console.log(resp);
const data = resp.data;
this.items = data.flights;
return data.flights;
});
}).catch(err => console.log(err));
},
delete(id) {
return apolloWrapper.mutate(DELETE_FLIGHT, {id}).then(({data}) => {