2020-04-14 12:34:14 +00:00
|
|
|
import { AxiosPromise } from "axios";
|
2021-03-22 09:22:24 +00:00
|
|
|
import Api from "api/Api";
|
2020-04-14 12:34:14 +00:00
|
|
|
import { ApiResponse } from "./ApiResponses";
|
|
|
|
|
|
|
|
|
|
export interface CurlImportRequest {
|
|
|
|
|
type: string;
|
|
|
|
|
pageId: string;
|
|
|
|
|
name: string;
|
|
|
|
|
curl: string;
|
2020-06-17 10:19:56 +00:00
|
|
|
organizationId: string;
|
2020-04-14 12:34:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class CurlImportApi extends Api {
|
|
|
|
|
static curlImportURL = `v1/import`;
|
|
|
|
|
|
|
|
|
|
static curlImport(request: CurlImportRequest): AxiosPromise<ApiResponse> {
|
2021-05-13 08:35:39 +00:00
|
|
|
const { curl, name, organizationId, pageId } = request;
|
2020-04-14 12:34:14 +00:00
|
|
|
return Api.post(CurlImportApi.curlImportURL, curl, {
|
|
|
|
|
type: "CURL",
|
|
|
|
|
pageId,
|
|
|
|
|
name,
|
2020-06-17 10:19:56 +00:00
|
|
|
organizationId,
|
2020-04-14 12:34:14 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default CurlImportApi;
|