mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-21 17:36:37 +00:00
24 lines
659 B
TypeScript
24 lines
659 B
TypeScript
import axios from 'api';
|
|
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
|
|
import { AxiosError } from 'axios';
|
|
import { ErrorResponse, SuccessResponse } from 'types/api';
|
|
import { PayloadProps, Props } from 'types/api/logs/addToSelectedFields';
|
|
|
|
const removeSelectedField = async (
|
|
props: Props,
|
|
): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
|
|
try {
|
|
const data = await axios.post(`/logs/fields`, props);
|
|
return {
|
|
statusCode: 200,
|
|
error: null,
|
|
message: '',
|
|
payload: data.data,
|
|
};
|
|
} catch (error) {
|
|
return Promise.reject(ErrorResponseHandler(error as AxiosError));
|
|
}
|
|
};
|
|
|
|
export default removeSelectedField;
|