Skip to content

Commit

Permalink
Fix server and template redirects on submit
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinaisslaying committed Jul 18, 2020
1 parent e1dd33c commit 905e118
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion assets/Views/templates/serverTemplates/submit.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion assets/Views/templates/servers/submit.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion release-info.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.1.4-Release",
"version": "5.1.5-Release",
"channel": "Release",
"cssVersion": "35be7ff97f88289372ece194f2e95161"
}
6 changes: 4 additions & 2 deletions src/Routes/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -599,7 +600,8 @@ router.post(
return res.status(200).json({
error: false,
status: 200,
errors: []
errors: [],
id: fetchRes.jsonBody.guild.id
});
})
.catch(() => {
Expand Down
6 changes: 4 additions & 2 deletions src/Routes/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ router.post(
return res.status(200).json({
error: false,
status: 200,
errors: []
errors: [],
id: fetchRes.jsonBody.code
});
})
.catch(async (fetchRes) => {
Expand Down Expand Up @@ -676,7 +677,8 @@ router.post(
return res.status(200).json({
error: false,
status: 200,
errors: []
errors: [],
id: fetchRes.jsonBody.code
});
})
.catch(() => {
Expand Down

0 comments on commit 905e118

Please sign in to comment.