mirror of
https://github.com/discourse/discourse.git
synced 2024-12-22 19:03:54 +08:00
c13f64d35b
* FEATURE: Add Filter for Webhook Events by Status * Fixing multiple issues * Lint * Fixing multiple issues * Change the range of the status for webhook events
26 lines
618 B
JavaScript
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;
|
|
}
|
|
}
|