From 905e118d3b26404782c8a35b1660f71282862615 Mon Sep 17 00:00:00 2001 From: Cairo2k18 Date: Sat, 18 Jul 2020 02:36:03 +0000 Subject: [PATCH] Fix server and template redirects on submit --- assets/Views/templates/serverTemplates/submit.ejs | 2 +- assets/Views/templates/servers/submit.ejs | 2 +- package.json | 2 +- release-info.json | 2 +- src/Routes/servers.ts | 6 ++++-- src/Routes/templates.ts | 6 ++++-- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/assets/Views/templates/serverTemplates/submit.ejs b/assets/Views/templates/serverTemplates/submit.ejs index 7254c311..d8dbfc3f 100644 --- a/assets/Views/templates/serverTemplates/submit.ejs +++ b/assets/Views/templates/serverTemplates/submit.ejs @@ -209,7 +209,7 @@ document.getElementById("cancelButton").setAttribute("href", "<%= linkPrefix %>/users/@me"); } else { removeEventListener("beforeunload", warn); - window.location = `<%= linkPrefix %>/templates/${document.getElementById("id").value}`; + window.location = `<%= linkPrefix %>/templates/${data.id}`; } }); } diff --git a/assets/Views/templates/servers/submit.ejs b/assets/Views/templates/servers/submit.ejs index dc8a5889..f08e62df 100644 --- a/assets/Views/templates/servers/submit.ejs +++ b/assets/Views/templates/servers/submit.ejs @@ -233,7 +233,7 @@ document.getElementById("cancelButton").setAttribute("href", "<%= linkPrefix %>/users/@me"); } else { removeEventListener("beforeunload", warn); - window.location = `<%= linkPrefix %>/servers/${document.getElementById("id").value}`; + window.location = `<%= linkPrefix %>/servers/${data.id}`; } }); } diff --git a/package.json b/package.json index 1315f97f..d98d9bf3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "del-website", - "version": "5.1.4-Release", + "version": "5.1.5-Release", "description": "Discord Extreme List, Discord's unbiased list! Official source code for the DEL v5 website!", "main": "dist/src/app.js", "directories": { diff --git a/release-info.json b/release-info.json index 2739d3f5..1acc2732 100644 --- a/release-info.json +++ b/release-info.json @@ -1,5 +1,5 @@ { - "version": "5.1.4-Release", + "version": "5.1.5-Release", "channel": "Release", "cssVersion": "35be7ff97f88289372ece194f2e95161" } diff --git a/src/Routes/servers.ts b/src/Routes/servers.ts index 4539bf89..d4cc84b6 100644 --- a/src/Routes/servers.ts +++ b/src/Routes/servers.ts @@ -216,7 +216,8 @@ router.post( return res.status(200).json({ error: false, status: 200, - errors: [] + errors: [], + id: fetchRes.jsonBody.guild.id }); }) .catch(async (fetchRes) => { @@ -599,7 +600,8 @@ router.post( return res.status(200).json({ error: false, status: 200, - errors: [] + errors: [], + id: fetchRes.jsonBody.guild.id }); }) .catch(() => { diff --git a/src/Routes/templates.ts b/src/Routes/templates.ts index 94bb85e8..91732fad 100644 --- a/src/Routes/templates.ts +++ b/src/Routes/templates.ts @@ -243,7 +243,8 @@ router.post( return res.status(200).json({ error: false, status: 200, - errors: [] + errors: [], + id: fetchRes.jsonBody.code }); }) .catch(async (fetchRes) => { @@ -676,7 +677,8 @@ router.post( return res.status(200).json({ error: false, status: 200, - errors: [] + errors: [], + id: fetchRes.jsonBody.code }); }) .catch(() => {