diff --git a/apps/wizarr-frontend/src/modules/help/components/Discord.vue b/apps/wizarr-frontend/src/modules/help/components/Discord.vue index 6e37da346..5e65a4dbb 100644 --- a/apps/wizarr-frontend/src/modules/help/components/Discord.vue +++ b/apps/wizarr-frontend/src/modules/help/components/Discord.vue @@ -73,7 +73,7 @@ export default defineComponent({ methods: { async loadWidgetAPI(guild: string) { // Load the Discord Widget API - const response = await this.$axios.get(`https://discord.com/api/guilds/${guild}/widget.json`).catch(() => { + const response = await this.$rawAxios.get(`https://discord.com/api/guilds/${guild}/widget.json`).catch(() => { this.$toast.info("Unable to load Discord Widget, this is most likely due to too many requests."); }); diff --git a/apps/wizarr-frontend/src/modules/settings/pages/Discord.vue b/apps/wizarr-frontend/src/modules/settings/pages/Discord.vue index c98145f9f..e080bf61c 100644 --- a/apps/wizarr-frontend/src/modules/settings/pages/Discord.vue +++ b/apps/wizarr-frontend/src/modules/settings/pages/Discord.vue @@ -60,15 +60,18 @@ export default defineComponent({ const formData = new FormData(); formData.append("server_discord_id", this.serverId); - const validate = await this.$axios.get(`https://discord.com/api/guilds/${this.serverId}/widget.json`).catch((validation) => { + const validate = await this.$rawAxios.get(`https://discord.com/api/guilds/${this.serverId}/widget.json`).catch((validation) => { + // Discord Docs: https://discord.com/developers/docs/topics/opcodes-and-status-codes if (validation.response.data.code === 50004) this.$toast.error(this.__("Unable to save due to widgets being disabled on this server.")); }); + if (!validate) return; + const response = await this.$axios.put("/api/settings", formData).catch(() => { this.$toast.error(this.__("Unable to save connection.")); }); - if (!response?.data || !validate?.data) return; + if (!response?.data) return; this.$toast.info("Discord Server ID saved successfully."); },