15 lines
496 B
TypeScript
15 lines
496 B
TypeScript
import { GetOrder } from "../../models/api";
|
|
|
|
import { api } from "./api";
|
|
import { extractBodyFromResponse, extractErrorMessageFromResponse } from "./utils";
|
|
|
|
export const landingApi = api.injectEndpoints({
|
|
endpoints: ({ query }) => ({
|
|
getOrder: query<GetOrder.Response, GetOrder.Params>({
|
|
query: ({ orderId }) => `/order/${orderId}`,
|
|
transformResponse: extractBodyFromResponse<GetOrder.Response>,
|
|
transformErrorResponse: extractErrorMessageFromResponse,
|
|
})
|
|
})
|
|
});
|