1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-20 01:31:34 +02:00
This commit is contained in:
TomatoCake 2024-07-18 15:36:00 +02:00
parent adc3474216
commit 4b1e9ba851
3 changed files with 24 additions and 9 deletions

View File

@ -63,10 +63,17 @@ router.get(
const instanceUrl =
Config.get().api.endpointPublic || "http://localhost:3001";
return res.json(webhooks.map(webhook => ({
...webhook,
url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token,
})));
return res.json(
webhooks.map((webhook) => ({
...webhook,
url:
instanceUrl +
"/webhooks/" +
webhook.id +
"/" +
webhook.token,
})),
);
},
);

View File

@ -49,10 +49,17 @@ router.get(
const instanceUrl =
Config.get().api.endpointPublic || "http://localhost:3001";
return res.json(webhooks.map(webhook => ({
...webhook,
url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token,
})));
return res.json(
webhooks.map((webhook) => ({
...webhook,
url:
instanceUrl +
"/webhooks/" +
webhook.id +
"/" +
webhook.token,
})),
);
},
);

View File

@ -11,7 +11,8 @@ const router = Router();
router.get(
"/",
route({
description: "Returns a webhook object for the given id. Requires the MANAGE_WEBHOOKS permission or to be the owner of the webhook.",
description:
"Returns a webhook object for the given id. Requires the MANAGE_WEBHOOKS permission or to be the owner of the webhook.",
responses: {
200: {
body: "APIWebhook",