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