- fix RIS in pendenti, se troppi msg, non compariva piu
- cataloghi, ricerca pickup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine } from 'model'
|
||||
import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor } from 'model'
|
||||
|
||||
import { Api } from '@api'
|
||||
import { serv_constants } from '@src/store/Modules/serv_constants'
|
||||
@@ -107,6 +107,7 @@ export const useProducts = defineStore('Products', {
|
||||
orders: [],
|
||||
catprods: [],
|
||||
catprods_gas: [],
|
||||
authors: [],
|
||||
subcatprods: [],
|
||||
productInfos: [],
|
||||
userActive: { username: '', name: '', surname: '', _id: '' },
|
||||
@@ -123,6 +124,24 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
},
|
||||
|
||||
getAuthors: (state: IProductsState) => (): any[] => {
|
||||
// Get the list of authors, for the q-select component using state.authors array
|
||||
// [{name: xxx, value: _id }]
|
||||
|
||||
// add default value for q-select
|
||||
const options = [
|
||||
{
|
||||
label: '[Tutti]',
|
||||
value: '',
|
||||
},
|
||||
...state.authors.map((rec: IAuthor) => {
|
||||
return { label: rec.name + (rec.surname ? ' ' + rec.surname : ''), value: rec._id }
|
||||
}),
|
||||
]
|
||||
return options
|
||||
},
|
||||
|
||||
|
||||
getNumProdTot: (state: IProductsState) => (): number => {
|
||||
return state.products.length
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user