started search router view

This commit is contained in:
2023-08-13 20:18:11 +02:00
parent 0fc1cd12dd
commit 749ffd3867
8 changed files with 218 additions and 70 deletions

50
src/stores/search.js Normal file
View File

@@ -0,0 +1,50 @@
import { defineStore } from 'pinia'
import { print } from 'graphql/language/printer'
import gql from 'graphql-tag'
// import REST from '@api/rest-axios'
import GQL from '@api/graphql-axios'
// import JSONAPI from '@api/json-axios'
import StaticsFields from '@api/gql/statics.fragment.gql'
export const SearchStore = defineStore({
id: 'search',
state: () => ({
// loaded: false,
}),
getters: {
},
actions: {
loadResults () {
console.log('search store loadResults');
// return new Promise((resolve, reject) => {
// const ast = gql`{
// promotedstatics {
// ...StaticsFields
// }
// }
// ${StaticsFields}
// `
// console.log('ast', ast);
// GQL.post('', { query: print(ast) })
// .then(({ data : { data : { promotedstatics } } }) => {
// console.log('loadstatics loaded', promotedstatics)
// this.statics = promotedstatics
// promotedstatics.forEach((s) => {
// // console.log("s", s);
// this.statics_byid[s.id] = s
// });
// console.log("statics_byid", this.statics_byid);
// this.loaded = true;
// })
// .catch(error => {
// console.warn('Issue with loadStatics', error)
// Promise.reject(error)
// })
// })
}
}
})