fix: Restore Webhook Test Functionality (#3857)

Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
Michael Genson 2024-07-06 14:10:01 -05:00 committed by GitHub
parent aa6e109162
commit 6e6ae80c46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 50 additions and 9 deletions

View file

@ -6,9 +6,15 @@ const prefix = "/api";
const routes = {
webhooks: `${prefix}/groups/webhooks`,
webhooksId: (id: string | number) => `${prefix}/groups/webhooks/${id}`,
webhooksIdTest: (id: string | number) => `${prefix}/groups/webhooks/${id}/test`,
};
export class WebhooksAPI extends BaseCRUDAPI<CreateWebhook, ReadWebhook> {
baseRoute = routes.webhooks;
itemRoute = routes.webhooksId;
itemTestRoute = routes.webhooksIdTest;
async testOne(itemId: string | number) {
return await this.requests.post<null>(`${this.itemTestRoute(itemId)}`, {});
}
}