13 lines
450 B
TypeScript
13 lines
450 B
TypeScript
import type { RequestCreateKP, ResponseCreateKP } from './types';
|
|
import getUrls from '@/config/urls';
|
|
import axios from 'axios';
|
|
|
|
const { URL_CRM_CREATEKP } = getUrls();
|
|
|
|
export async function createKP(payload: RequestCreateKP): Promise<ResponseCreateKP> {
|
|
return await axios
|
|
.post(URL_CRM_CREATEKP, payload)
|
|
.then((response) => ({ ...response.data, success: true }))
|
|
.catch((error) => ({ ...error.response.data, success: false }));
|
|
}
|