mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-30 15:32:03 +08:00

* chore(dashboard): intial commit * chore(dashboard): bring all the code in module * chore(dashboard): remove lock unlock from ee codebase * chore(dashboard): go deps * chore(dashboard): fix lint * chore(dashboard): implement the store * chore(dashboard): add migration * chore(dashboard): fix lint * chore(dashboard): api and frontend changes * chore(dashboard): frontend changes for new dashboards * chore(dashboard): fix test cases * chore(dashboard): add lock unlock APIs * chore(dashboard): add lock unlock APIs * chore(dashboard): move integrations controller out from module * chore(dashboard): move integrations controller out from module * chore(dashboard): move integrations controller out from module * chore(dashboard): rename migration file * chore(dashboard): surface errors for lock/unlock dashboard * chore(dashboard): some testing cleanups * chore(dashboard): fix postgres migrations --------- Co-authored-by: Vibhu Pandey <vibhupandey28@gmail.com>
21 lines
658 B
TypeScript
21 lines
658 B
TypeScript
import axios from 'api';
|
|
import { ErrorResponseHandlerV2 } from 'api/ErrorResponseHandlerV2';
|
|
import { AxiosError } from 'axios';
|
|
import { ErrorV2Resp, SuccessResponseV2 } from 'types/api';
|
|
import { PayloadProps, Props } from 'types/api/dashboard/get';
|
|
import { Dashboard } from 'types/api/dashboard/getAll';
|
|
|
|
const get = async (props: Props): Promise<SuccessResponseV2<Dashboard>> => {
|
|
try {
|
|
const response = await axios.get<PayloadProps>(`/dashboards/${props.id}`);
|
|
return {
|
|
httpStatusCode: response.status,
|
|
data: response.data.data,
|
|
};
|
|
} catch (error) {
|
|
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
|
|
}
|
|
};
|
|
|
|
export default get;
|