mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-29 16:14:42 +00:00
* feat: integrate billing api and wire up billing ui * feat: show billing to admin only if on plans other than basic plan * feat: show billing to admin only if on plans other than basic plan * feat: update notfound snapshot * chore: fix billing sidenav logic * chore: fix several bugs * chore: backend fix for billing * fix: window.open pop blocker issue and error ui (#3750) --------- Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
28 lines
737 B
TypeScript
28 lines
737 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/dashboard/create';
|
|
|
|
const createDashboard = async (
|
|
props: Props,
|
|
): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
|
|
const url = props.uploadedGrafana ? '/dashboards/grafana' : '/dashboards';
|
|
try {
|
|
const response = await axios.post(url, {
|
|
...props,
|
|
});
|
|
|
|
return {
|
|
statusCode: 200,
|
|
error: null,
|
|
message: response.data.status,
|
|
payload: response.data.data,
|
|
};
|
|
} catch (error) {
|
|
return ErrorResponseHandler(error as AxiosError);
|
|
}
|
|
};
|
|
|
|
export default createDashboard;
|