Homepage, verejna cast, vetsi sada uprav a oprav
This commit is contained in:
@@ -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}) => {
|
||||
|
||||
Reference in New Issue
Block a user