mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-30 02:59:29 +00:00
No more fallback URLs
This commit is contained in:
@@ -43,11 +43,10 @@ router.get(
|
||||
relations: ["user", "channel", "source_channel", "guild", "source_guild", "application"],
|
||||
});
|
||||
|
||||
const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001";
|
||||
return res.json(
|
||||
webhooks.map((webhook) => ({
|
||||
...webhook,
|
||||
url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token,
|
||||
url: Config.get().api.endpointPublic + "/webhooks/" + webhook.id + "/" + webhook.token,
|
||||
})),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -35,10 +35,9 @@ router.get(
|
||||
throw DiscordApiErrors.INVALID_WEBHOOK_TOKEN_PROVIDED;
|
||||
}
|
||||
|
||||
const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001";
|
||||
return res.json({
|
||||
...webhook,
|
||||
url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token,
|
||||
url: Config.get().api.endpointPublic + "/webhooks/" + webhook.id + "/" + webhook.token,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -29,10 +29,9 @@ router.get(
|
||||
if (!permission.has("MANAGE_WEBHOOKS")) throw DiscordApiErrors.UNKNOWN_WEBHOOK;
|
||||
} else if (webhook.user_id != req.user_id) throw DiscordApiErrors.UNKNOWN_WEBHOOK;
|
||||
|
||||
const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001";
|
||||
return res.json({
|
||||
...webhook,
|
||||
url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token,
|
||||
url: Config.get().api.endpointPublic + "/webhooks/" + webhook.id + "/" + webhook.token,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user