fix: แก้ type Service
This commit is contained in:
parent
3fca303b4e
commit
c65e2b535d
2 changed files with 18 additions and 15 deletions
|
|
@ -14,7 +14,7 @@ import {
|
|||
ProductUpdate,
|
||||
Service,
|
||||
ServiceCreate,
|
||||
ResultProductOnWork,
|
||||
ServiceById,
|
||||
} from './types';
|
||||
|
||||
const useProductServiceStore = defineStore('api-product-service', () => {
|
||||
|
|
@ -423,7 +423,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
|
||||
const query = params.toString();
|
||||
|
||||
const res = await api.get<Pagination<ResultProductOnWork[]>>(
|
||||
const res = await api.get<Pagination<ServiceById[]>>(
|
||||
`/service/${serviceId}/work${(params && '?'.concat(query)) || ''}`,
|
||||
{
|
||||
headers: {
|
||||
|
|
@ -443,7 +443,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
}
|
||||
|
||||
async function fetchListServiceById(serviceId: string) {
|
||||
const res = await api.get<Service>(`/service/${serviceId}`);
|
||||
const res = await api.get<ServiceById>(`/service/${serviceId}`);
|
||||
|
||||
if (!res) return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export interface Service {
|
|||
createdAt: string;
|
||||
createdBy: string;
|
||||
status: string;
|
||||
attributes: string;
|
||||
attributes: Attributes;
|
||||
detail: string;
|
||||
name: string;
|
||||
code: string;
|
||||
|
|
@ -17,15 +17,16 @@ export interface Service {
|
|||
}
|
||||
|
||||
export interface Work {
|
||||
updatedAt: string;
|
||||
updateBy: string;
|
||||
createdAt: string;
|
||||
createdBy: string;
|
||||
serviceId: string;
|
||||
status: string;
|
||||
attributes: string;
|
||||
name: string;
|
||||
id: string;
|
||||
order: number;
|
||||
name: string;
|
||||
attributes: Attributes;
|
||||
status: Status;
|
||||
serviceId: string;
|
||||
createdBy: string | null;
|
||||
createdAt: string;
|
||||
updateBy: string | null;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface ServiceCreate {
|
||||
|
|
@ -50,16 +51,18 @@ export interface Attributes {
|
|||
type AdditionalType = 'string' | 'number' | 'boolean' | Date;
|
||||
// Product
|
||||
|
||||
export interface ResultProductOnWork {
|
||||
productOnWork: ProductOnWork[];
|
||||
export interface ServiceById {
|
||||
work: Work & { productOnWork: ProductOnWork[] }[];
|
||||
updatedAt: string;
|
||||
updateBy: string;
|
||||
createdAt: string;
|
||||
createdBy: string;
|
||||
status: string;
|
||||
status: Status;
|
||||
attributes: string;
|
||||
name: string;
|
||||
order: number;
|
||||
id: string;
|
||||
imageUrl: 'string';
|
||||
}
|
||||
|
||||
export interface ProductOnWork {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue