started search router view
This commit is contained in:
50
src/stores/search.js
Normal file
50
src/stores/search.js
Normal 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)
|
||||
// })
|
||||
// })
|
||||
}
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user