Drobne upravy ve vizualu, oprava comboboxu, funkcni prakticky cela editace letu
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import {defineStore} from 'pinia'
|
||||
import {apolloWrapper} from "src/graphql/apollo";
|
||||
import {COPILOTS_LIST} from "src/graphql/queries/copilots";
|
||||
|
||||
export const useCopilotsStore = defineStore('SecondPilots', {
|
||||
state: () => ({
|
||||
items: []
|
||||
}),
|
||||
|
||||
getters: {},
|
||||
|
||||
actions: {
|
||||
create(formData) {
|
||||
console.log("not implemented");
|
||||
},
|
||||
fetch() {
|
||||
return apolloWrapper.query(COPILOTS_LIST).then(result => {
|
||||
this.items = result.data.copilots;
|
||||
return result.data.copilots;
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,26 +0,0 @@
|
||||
import {defineStore} from 'pinia'
|
||||
|
||||
export const useSecondPilotsStore = defineStore('SecondPilots', {
|
||||
state: () => ({
|
||||
items: []
|
||||
}),
|
||||
|
||||
getters: {},
|
||||
|
||||
actions: {
|
||||
create(formData) {
|
||||
this.items.push(formData);
|
||||
},
|
||||
fetch() {
|
||||
if (this.items.length > 0) return;
|
||||
|
||||
this.$patch({
|
||||
items: [
|
||||
{id: 1, name: "Karel Franta", isInstructor: false},
|
||||
{id: 2, name: "Franta Pepa", isInstructor: false},
|
||||
{id: 3, name: "Instruktor Letajici", isInstructor: true},
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user