discourse/app/assets/javascripts/admin/addon/adapters/web-hook-event.js
Guhyoun Nam c13f64d35b
FEATURE: Add Filter for Webhook Events by Status (#27332)
* FEATURE: Add Filter for Webhook Events by Status

* Fixing multiple issues

* Lint

* Fixing multiple issues

* Change the range of the status for webhook events
2024-06-07 10:26:00 -05:00

26 lines
618 B
JavaScript

import RestAdapter from "discourse/adapters/rest";
export default class WebHookEvent extends RestAdapter {
basePath() {
return "/admin/api/";
}
appendQueryParams(path, findArgs, extension) {
const urlSearchParams = new URLSearchParams();
for (const [key, value] of Object.entries(findArgs)) {
if (value && key !== "webhookId") {
urlSearchParams.set(key, value);
}
}
const queryString = urlSearchParams.toString();
let url = `${path}/${findArgs.webhookId}${extension || ""}`;
if (queryString) {
url = `${url}?${queryString}`;
}
return url;
}
}