Add a querystring option to disable the poll create success message

This commit is contained in:
Oliver Akins 2022-02-17 17:22:00 -06:00
parent 94daa6e4eb
commit 7632a7931d
No known key found for this signature in database
GPG key ID: 3C2014AF9457AF99
2 changed files with 10 additions and 4 deletions

View file

@ -76,8 +76,11 @@ let app = new Vue({
methods: { methods: {
async start_poll(poll_data) { async start_poll(poll_data) {
try { try {
let r = await axios.post("/twitch/alkali_metal/poll", poll_data); await axios.post("/polls/twitch/alkali_metal/poll", poll_data);
let qs = new URLSearchParams(window.location.search);
if (!qs.has("no_alert")) {
alert("Poll should've been created successfully."); alert("Poll should've been created successfully.");
};
} catch (err) { } catch (err) {
console.error(err); console.error(err);
alert("Something went wrong starting the poll, check to see if one is made already.") alert("Something went wrong starting the poll, check to see if one is made already.")

View file

@ -76,8 +76,11 @@ let app = new Vue({
methods: { methods: {
async start_poll(poll_data) { async start_poll(poll_data) {
try { try {
let r = await axios.post("/polls/twitch/czechgamesedition/poll", poll_data); await axios.post("/polls/twitch/czechgamesedition/poll", poll_data);
let qs = new URLSearchParams(window.location.search);
if (!qs.has("no_alert")) {
alert("Poll should've been created successfully."); alert("Poll should've been created successfully.");
};
} catch (err) { } catch (err) {
console.error(err); console.error(err);
alert("Something went wrong starting the poll, check to see if one is made already.") alert("Something went wrong starting the poll, check to see if one is made already.")