openreplay/frontend/app/services/WebhookService.ts
Andrey Babushkin fd5c0c9747
Add lokalisation (#3092)
* applied eslint

* add locales and lint the project

* removed error boundary

* updated locales

* fix min files

* fix locales
2025-03-06 17:43:15 +01:00

25 lines
624 B
TypeScript

import Webhook, { IWebhook } from 'Types/webhook';
import BaseService from './BaseService';
export default class WebhookService extends BaseService {
fetchList(): Promise<IWebhook[]> {
return this.client
.get('/webhooks')
.then((r) => r.json())
.then((j) => j.data || []);
}
saveWebhook(inst: Webhook) {
return this.client
.put('/webhooks', inst)
.then((r) => r.json())
.then((j) => j.data || {});
}
removeWebhook(id: Webhook['webhookId']) {
return this.client
.delete(`/webhooks/${id}`)
.then((r) => r.json())
.then((j) => j.data || {});
}
}