@grafana/alerting
Version:
Grafana Alerting Library – Build vertical integrations on top of the industry-leading alerting solution
1 lines • 1.16 kB
Source Map (JSON)
{"version":3,"file":"replaceReceiverHandler.mjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type ReplaceReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function replaceReceiverHandler(\n data: ReplaceReceiverApiResponse | ((info: Parameters<Parameters<typeof http.put>[1]>[0]) => Response)\n) {\n return http.put(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers/:name'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":[],"mappings":";;;;;AAUO,SAAS,uBACd,IAAA,EACA;AACA,EAAA,OAAO,IAAA,CAAK,IAAI,qBAAA,CAAsB,SAAA,EAAW,aAAa,kBAAkB,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACxG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAO,YAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}