fix: ticket detail api fallback handle
This commit is contained in:
@@ -35,11 +35,13 @@ export const ticketService = {
|
||||
|
||||
getTicketDetail: async (
|
||||
ticketId: string,
|
||||
defectClass: string,
|
||||
defectClass?: string,
|
||||
): Promise<TicketDetail> => {
|
||||
const response = await axiosClient.get<TicketDetail>(
|
||||
API_ROUTES.TICKETS.DETAIL(ticketId, defectClass),
|
||||
);
|
||||
const path = defectClass
|
||||
? API_ROUTES.TICKETS.CLASS_DETAIL(ticketId, defectClass)
|
||||
: API_ROUTES.TICKETS.DETAIL(ticketId);
|
||||
|
||||
const response = await axiosClient.get<TicketDetail>(path);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user