Use modals instead of toasts
This commit is contained in:
parent
8578e72ecd
commit
a8f7251b34
@ -252,12 +252,12 @@
|
|||||||
const res = await axios.delete('/api/{{.guildId}}/panels/' + messageId);
|
const res = await axios.delete('/api/{{.guildId}}/panels/' + messageId);
|
||||||
|
|
||||||
if (res.status === 200 && res.data.success) {
|
if (res.status === 200 && res.data.success) {
|
||||||
showToast('Success', 'Panel deleted successfully');
|
notifySuccess('Panel deleted successfully');
|
||||||
|
|
||||||
const el = document.getElementById(messageId);
|
const el = document.getElementById(messageId);
|
||||||
el.parentNode.removeChild(el);
|
el.parentNode.removeChild(el);
|
||||||
} else {
|
} else {
|
||||||
showToast('Error', res.data.error);
|
notifyError(res.data.error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,9 +295,9 @@
|
|||||||
if (res.status === 200 && res.data.success) {
|
if (res.status === 200 && res.data.success) {
|
||||||
data.message_id = res.data.message_id;
|
data.message_id = res.data.message_id;
|
||||||
appendPanel(data, await getChannels());
|
appendPanel(data, await getChannels());
|
||||||
showToast('Success', 'Panel created successfully')
|
notifySuccess('Panel created successfully')
|
||||||
} else {
|
} else {
|
||||||
showToast('Error', res.data.error);
|
notifyError(res.data.error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,7 +437,7 @@
|
|||||||
async function fillPanels(channels) {
|
async function fillPanels(channels) {
|
||||||
const res = await axios.get('/api/{{.guildId}}/panels');
|
const res = await axios.get('/api/{{.guildId}}/panels');
|
||||||
if (res.status !== 200) {
|
if (res.status !== 200) {
|
||||||
showToast("Error", res.data);
|
notifyError(res.data);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,7 +454,7 @@
|
|||||||
async function fillMultiPanels() {
|
async function fillMultiPanels() {
|
||||||
const res = await axios.get('/api/{{.guildId}}/multipanels');
|
const res = await axios.get('/api/{{.guildId}}/multipanels');
|
||||||
if (res.status !== 200) {
|
if (res.status !== 200) {
|
||||||
showToast("Error", res.data);
|
notifyError(res.data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,7 +488,7 @@
|
|||||||
// roles
|
// roles
|
||||||
const res = await axios.get('/api/{{.guildId}}/roles');
|
const res = await axios.get('/api/{{.guildId}}/roles');
|
||||||
if (res.status !== 200 || !res.data.success) {
|
if (res.status !== 200 || !res.data.success) {
|
||||||
showToast("Error", res.data);
|
notifyError(res.data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,9 +373,9 @@
|
|||||||
|
|
||||||
const res = await axios.post('/api/{{.guildId}}/claimsettings', data);
|
const res = await axios.post('/api/{{.guildId}}/claimsettings', data);
|
||||||
if (res.status === 200 && res.data.success) {
|
if (res.status === 200 && res.data.success) {
|
||||||
showToast("Success", "Your settings have been saved.");
|
notifySuccess("Your settings have been saved.");
|
||||||
} else {
|
} else {
|
||||||
showToast("Error", res.data.error);
|
notifyError(res.data.error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,11 +439,11 @@
|
|||||||
|
|
||||||
const res = await axios.post('/api/{{.guildId}}/autoclose', data);
|
const res = await axios.post('/api/{{.guildId}}/autoclose', data);
|
||||||
if (res.status !== 200 || !res.data.success) {
|
if (res.status !== 200 || !res.data.success) {
|
||||||
showToast('Error', res.data.error);
|
notifyError(res.data.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
showToast('Success', 'Auto close settings updated');
|
notifySuccess('Auto close settings updated');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -466,10 +466,10 @@
|
|||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const success = showValidations(res.data);
|
const success = showValidations(res.data);
|
||||||
if (success) {
|
if (success) {
|
||||||
showToast("Success", "Your settings have been saved.");
|
notifySuccess("Your settings have been saved.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
showToast("Error", "A severe error occurred. Please check your console for more information.");
|
notifyError("A severe error occurred. Please check your console for more information.");
|
||||||
console.log(res);
|
console.log(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -479,32 +479,32 @@
|
|||||||
|
|
||||||
if (!data.prefix) {
|
if (!data.prefix) {
|
||||||
success = false;
|
success = false;
|
||||||
showToast("Warning", "Your prefix has not been saved.<br />Prefixes must be between 1 - 8 characters in length.")
|
notify("Warning", "Your prefix has not been saved.<br />Prefixes must be between 1 - 8 characters in length.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.welcome_message) {
|
if (!data.welcome_message) {
|
||||||
success = false;
|
success = false;
|
||||||
showToast("Warning", "Your welcome message has not been saved.<br />Welcome messages must be between 1 - 1000 characters in length.")
|
notify("Warning", "Your welcome message has not been saved.<br />Welcome messages must be between 1 - 1000 characters in length.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.ticket_limit) {
|
if (!data.ticket_limit) {
|
||||||
success = false;
|
success = false;
|
||||||
showToast("Warning", "Your ticket limit has not been saved.<br />Ticket limits must be in the range 1 - 10.")
|
notify("Warning", "Your ticket limit has not been saved.<br />Ticket limits must be in the range 1 - 10.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.archive_channel) {
|
if (!data.archive_channel) {
|
||||||
success = false;
|
success = false;
|
||||||
showToast("Warning", "Your archive channel has not been saved.")
|
notify("Warning", "Your archive channel has not been saved.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.category) {
|
if (!data.category) {
|
||||||
success = false;
|
success = false;
|
||||||
showToast("Warning", "Your channel category has not been saved.")
|
notify("Warning", "Your channel category has not been saved.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.naming_scheme) {
|
if (!data.naming_scheme) {
|
||||||
success = false;
|
success = false;
|
||||||
showToast("Warning", "Your archive channel has not been saved.")
|
notify("Warning", "Your archive channel has not been saved.")
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user