mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-04 22:20:42 +08:00

* 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>
35 lines
819 B
TypeScript
35 lines
819 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/createMsTeams';
|
|
|
|
const testMsTeams = async (
|
|
props: Props,
|
|
): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
|
|
try {
|
|
const response = await axios.post('/testChannel', {
|
|
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 testMsTeams;
|