signoz/frontend/src/api/channels/editMsTeams.ts
Amol Umbark 2bf534b56f
feat: add ms teams channels (#2689)
* feat: api machinery to support enterprise plan channels

* feat: backend for handling ms teams

* feat: frontend for ms teams

* fix: fixed some minor issues wiht ms teams

* fix: resolved issue with feature gate

* chore: add missing span metrics

* chore: some minor changes are updated

* feat: added the oss flag is updated

---------

Co-authored-by: Vishal Sharma <makeavish786@gmail.com>
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
Co-authored-by: Palash Gupta <palashgdev@gmail.com>
2023-08-15 21:19:05 +05:30

35 lines
825 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/channels/editMsTeams';
const editMsTeams = async (
props: Props,
): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
try {
const response = await axios.put(`/channels/${props.id}`, {
name: props.name,
msteams_configs: [
{
send_resolved: true,
webhook_url: props.webhook_url,
title: props.title,
text: props.text,
},
],
});
return {
statusCode: 200,
error: null,
message: 'Success',
payload: response.data.data,
};
} catch (error) {
return ErrorResponseHandler(error as AxiosError);
}
};
export default editMsTeams;