Some Changes
This commit is contained in:
@@ -32,6 +32,7 @@ export const useDataStore = defineStore('data', {
|
||||
products: [] as any[],
|
||||
movements: [] as any[],
|
||||
forms: [] as any[],
|
||||
contracts: [] as any[],
|
||||
jobs: [] as any[],
|
||||
formSubmits: [] as any[],
|
||||
contacts: [] as any[],
|
||||
@@ -52,6 +53,7 @@ export const useDataStore = defineStore('data', {
|
||||
|
||||
|
||||
await this.fetchCustomers()
|
||||
await this.fetchContracts()
|
||||
await this.fetchForms()
|
||||
await this.fetchFormSubmits()
|
||||
await this.fetchProducts()
|
||||
@@ -77,6 +79,10 @@ export const useDataStore = defineStore('data', {
|
||||
// @ts-ignore
|
||||
this.events = (await supabase.from("events").select()).data
|
||||
},
|
||||
async fetchContracts() {
|
||||
// @ts-ignore
|
||||
this.contracts = (await supabase.from("contracts").select()).data
|
||||
},
|
||||
async fetchCustomers() {
|
||||
// @ts-ignore
|
||||
this.customers = (await supabase.from("customers").select().order('customerNumber', {ascending: true})).data
|
||||
@@ -160,6 +166,8 @@ export const useDataStore = defineStore('data', {
|
||||
getProductById: (state) => (productId:number) => state.products.find(product => product.id === productId),
|
||||
getVendorById: (state) => (itemId:number) => state.vendors.find(item => item.id === itemId),
|
||||
getVendorInvoiceById: (state) => (itemId:number) => state.vendorInvoices.find(item => item.id === itemId),
|
||||
getContractById: (state) => (itemId:number) => state.contracts.find(item => item.id === itemId),
|
||||
getDocumentById: (state) => (itemId:number) => state.documents.find(item => item.id === itemId),
|
||||
getSpaceById: (state) => (itemId:number) => state.spaces.find(item => item.id === itemId),
|
||||
getProjectById: (state) => (projectId:number) => {
|
||||
let project = state.projects.find(project => project.id === projectId)
|
||||
|
||||
Reference in New Issue
Block a user