updates!
This commit is contained in:
parent
bb54c951ee
commit
bb36976fff
@ -15,10 +15,10 @@
|
||||
name,
|
||||
body
|
||||
};
|
||||
var name = document.getElementById('name');
|
||||
var body = document.getElementById('body');
|
||||
var nameValue = document.getElementById('name');
|
||||
var bodyValue = document.getElementById('body');
|
||||
|
||||
if (name.value !== '' && body.value !== '') {
|
||||
if (nameValue.value !== '' && bodyValue.value !== '') {
|
||||
try {
|
||||
const response = await fetch('https://helpdeskapi.mpe.ca/api/message', {
|
||||
method: 'POST',
|
||||
@ -31,8 +31,8 @@
|
||||
if (response.ok) {
|
||||
console.log('POST request successful');
|
||||
toastr.success('One of the members of the IT department will contact you shortly', 'Message sent!');
|
||||
body.value = '';
|
||||
name.value = '';
|
||||
nameValue.value = '';
|
||||
bodyValue.value = '';
|
||||
} else {
|
||||
console.error('Error:', response.status);
|
||||
toastr.error('Error: ' + response.status, 'Message not sent');
|
||||
|
Loading…
Reference in New Issue
Block a user