feat: เพิ่ม opts
This commit is contained in:
parent
6c54711271
commit
9c266eee82
1 changed files with 14 additions and 5 deletions
|
|
@ -40,7 +40,11 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
}
|
||||
|
||||
async function fetchListProductServiceType(
|
||||
opts?: { query?: string; productGroupId?: string },
|
||||
opts?: {
|
||||
query?: string;
|
||||
productGroupId?: string;
|
||||
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE';
|
||||
},
|
||||
flow?: {
|
||||
sessionId: string;
|
||||
refTransactionId: string;
|
||||
|
|
@ -90,7 +94,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
|
||||
if (!res) return false;
|
||||
|
||||
if (res.status === 200) {
|
||||
if (res.status === 201) {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
|
|
@ -154,7 +158,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
}
|
||||
|
||||
async function fetchListProductService(
|
||||
opts?: { query?: string },
|
||||
opts?: { query?: string; status?: 'CREATED' | 'ACTIVE' | 'INACTIVE' },
|
||||
flow?: {
|
||||
sessionId: string;
|
||||
refTransactionId: string;
|
||||
|
|
@ -234,7 +238,12 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
|
||||
// Product
|
||||
async function fetchListProduct(
|
||||
opts?: { query?: string; page?: number; pageSize?: number },
|
||||
opts?: {
|
||||
query?: string;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
productTypeId?: string;
|
||||
},
|
||||
flow?: {
|
||||
sessionId: string;
|
||||
refTransactionId: string;
|
||||
|
|
@ -269,7 +278,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
}
|
||||
|
||||
async function createProduct(data: ProductCreate) {
|
||||
const { code, ...payload } = data;
|
||||
const { ...payload } = data;
|
||||
|
||||
const res = await api.post<ProductCreate>('/product', {
|
||||
...payload,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue