feat: api upload car img (#88)

This commit is contained in:
RustamRu
2025-02-22 18:56:37 +03:00
committed by ilnaz
parent 91fc91230b
commit ecf6c60cdc
7 changed files with 58 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
import { GetOrder, CreateOrder } from "../../models/api";
import { GetOrder, CreateOrder, UploadCarImage } from "../../models/api";
import { api } from "./api";
import { extractBodyFromResponse, extractErrorMessageFromResponse } from "./utils";
@@ -19,5 +19,13 @@ export const landingApi = api.injectEndpoints({
transformResponse: extractBodyFromResponse<CreateOrder.Response>,
transformErrorResponse: extractErrorMessageFromResponse,
}),
uploadCarImage: mutation<UploadCarImage.Response, UploadCarImage.Params>({
query: ({ orderId, body }) => ({
url: `/order/${orderId}/upload-car-img`,
body,
method: 'POST'
}),
transformErrorResponse: extractErrorMessageFromResponse,
}),
})
});