PromucFlow_constructor/app/client/src/api/ImportApi.ts
Hetu Nandu af3b5d212f fix: ui fixes and type defination fixes
- avoid using any or undefined types in the code
- fix ui issues for api home screen
- update naming convensions
- remove unwanted code
- use color variables
2020-04-14 12:34:14 +00:00

26 lines
558 B
TypeScript

import { AxiosPromise } from "axios";
import Api from "./Api";
import { ApiResponse } from "./ApiResponses";
export interface CurlImportRequest {
type: string;
pageId: string;
name: string;
curl: string;
}
class CurlImportApi extends Api {
static curlImportURL = `v1/import`;
static curlImport(request: CurlImportRequest): AxiosPromise<ApiResponse> {
const { pageId, name, curl } = request;
return Api.post(CurlImportApi.curlImportURL, curl, {
type: "CURL",
pageId,
name,
});
}
}
export default CurlImportApi;