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(
|
async function fetchListProductServiceType(
|
||||||
opts?: { query?: string; productGroupId?: string },
|
opts?: {
|
||||||
|
query?: string;
|
||||||
|
productGroupId?: string;
|
||||||
|
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE';
|
||||||
|
},
|
||||||
flow?: {
|
flow?: {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
refTransactionId: string;
|
refTransactionId: string;
|
||||||
|
|
@ -90,7 +94,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
|
|
||||||
if (!res) return false;
|
if (!res) return false;
|
||||||
|
|
||||||
if (res.status === 200) {
|
if (res.status === 201) {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -154,7 +158,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchListProductService(
|
async function fetchListProductService(
|
||||||
opts?: { query?: string },
|
opts?: { query?: string; status?: 'CREATED' | 'ACTIVE' | 'INACTIVE' },
|
||||||
flow?: {
|
flow?: {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
refTransactionId: string;
|
refTransactionId: string;
|
||||||
|
|
@ -234,7 +238,12 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
|
|
||||||
// Product
|
// Product
|
||||||
async function fetchListProduct(
|
async function fetchListProduct(
|
||||||
opts?: { query?: string; page?: number; pageSize?: number },
|
opts?: {
|
||||||
|
query?: string;
|
||||||
|
page?: number;
|
||||||
|
pageSize?: number;
|
||||||
|
productTypeId?: string;
|
||||||
|
},
|
||||||
flow?: {
|
flow?: {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
refTransactionId: string;
|
refTransactionId: string;
|
||||||
|
|
@ -269,7 +278,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createProduct(data: ProductCreate) {
|
async function createProduct(data: ProductCreate) {
|
||||||
const { code, ...payload } = data;
|
const { ...payload } = data;
|
||||||
|
|
||||||
const res = await api.post<ProductCreate>('/product', {
|
const res = await api.post<ProductCreate>('/product', {
|
||||||
...payload,
|
...payload,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue