signoz/frontend/src/api/metrics/getService.ts
Rajat Dabade b9409820cc
refactor: remove the dependency of services from redux (#2998)
* refactor: remove the dependency of services using redux

* refactor: seperated columns and unit test case

* refactor: move the constant to other file

* refactor: updated test case

* refactor: removed the duplicate enum

* fix: removed the inline function

* fix: removed the inline function

* refactor: removed the magic string

* fix: change the name from matrics to metrics

* fix: one on one mapping of props

* refactor: created a hook to getting services through api call

* fix: linter error

* refactor: renamed the file according to functionality

* refactor: renamed more file according to functionality

* refactor: removed unwanted interfaces and renamed files

* refactor: separated types

* refactor: shifted mock data and completed review changes

* chore: updated test cases

* refactor: added useEffect in errornotification

* chore: updated service test

* chore: shifted loading to table level

* chore: updated test cases

---------

Co-authored-by: Vishal Sharma <makeavish786@gmail.com>
2023-07-25 20:45:12 +05:30

14 lines
349 B
TypeScript

import axios from 'api';
import { PayloadProps, Props } from 'types/api/metrics/getService';
const getService = async (props: Props): Promise<PayloadProps> => {
const response = await axios.post(`/services`, {
start: `${props.start}`,
end: `${props.end}`,
tags: props.selectedTags,
});
return response.data;
};
export default getService;