composables, mazani letu, skeletony

This commit is contained in:
Michal Kváček
2023-07-24 17:31:54 +02:00
parent 4648c30f90
commit 864db6c6a2
53 changed files with 732 additions and 273 deletions
+4 -1
View File
@@ -1,6 +1,6 @@
import {defineStore} from 'pinia'
import {apolloWrapper} from "src/graphql/apollo";
import {COPILOTS_LIST} from "src/graphql/queries/copilots";
import {COPILOTS_DETAIL, COPILOTS_LIST} from "src/graphql/queries/copilots";
export const useCopilotsStore = defineStore('SecondPilots', {
state: () => ({
@@ -13,6 +13,9 @@ export const useCopilotsStore = defineStore('SecondPilots', {
create(formData) {
console.log("not implemented");
},
fetchDetail(copilotId) {
return apolloWrapper.query(COPILOTS_DETAIL, {id: copilotId}).then(({data}) => data.copilot);
},
fetch() {
return apolloWrapper.query(COPILOTS_LIST).then(result => {
this.items = result.data.copilots;