feat(ticket): split overview/class detail queries and add loading skeletons
This commit is contained in:
@@ -10,6 +10,7 @@ import type {
|
||||
SubmitRepairPayload,
|
||||
SubmitRepairUploadPayload,
|
||||
TicketDetail,
|
||||
TicketOverviewDetail,
|
||||
TicketDefectClassesResponse,
|
||||
TicketListParams,
|
||||
TicketListResponse,
|
||||
@@ -32,15 +33,22 @@ export const ticketService = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
getTicketDetail: async (
|
||||
getTicketOverview: async (
|
||||
ticketId: string,
|
||||
defectClass?: string,
|
||||
): Promise<TicketDetail> => {
|
||||
const path = defectClass
|
||||
? API_ROUTES.TICKETS.CLASS_DETAIL(ticketId, defectClass)
|
||||
: API_ROUTES.TICKETS.DETAIL(ticketId);
|
||||
): Promise<TicketOverviewDetail> => {
|
||||
const response = await axiosClient.get<TicketOverviewDetail>(
|
||||
API_ROUTES.TICKETS.DETAIL(ticketId),
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
const response = await axiosClient.get<TicketDetail>(path);
|
||||
getTicketClassDetail: async (
|
||||
ticketId: string,
|
||||
defectClass: string,
|
||||
): Promise<TicketDetail> => {
|
||||
const response = await axiosClient.get<TicketDetail>(
|
||||
API_ROUTES.TICKETS.CLASS_DETAIL(ticketId, defectClass),
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user