Merge branch 'main' of https://github.com/Newtbot/MP
This commit is contained in:
commit
638993a66a
@ -9,7 +9,7 @@ i repeat DO NOT USE CREDS IN CODE! Please use .env files (https://www.npmjs.com/
|
||||
1) Ti Seng
|
||||
* Webserver Microservices
|
||||
* IoT sensor
|
||||
* All Database / Backend Functions
|
||||
* Most Database / Backend Functions of this repo
|
||||
* consumer website api and user function
|
||||
2) Sean
|
||||
* Admin Website Microservice
|
||||
|
@ -256,7 +256,7 @@ app.auth = (function (app) {
|
||||
};
|
||||
})(app);
|
||||
|
||||
//ajax form submit
|
||||
//ajax form submit and pass to api
|
||||
function formAJAX(btn, del) {
|
||||
event.preventDefault(); // avoid to execute the actual submit of the form.
|
||||
var $form = $(btn).closest("[action]"); // gets the 'form' parent
|
||||
|
@ -51,11 +51,27 @@ router.get('/news', function(req, res, next) {
|
||||
res.render('news');
|
||||
});
|
||||
|
||||
//learn more page
|
||||
router.get('/learnmore', function(req, res, next) {
|
||||
res.render('learnmore');
|
||||
});
|
||||
|
||||
//login | register page
|
||||
router.get('/login', function(req, res, next) {
|
||||
res.render('signuplogin');
|
||||
});
|
||||
|
||||
//profile page
|
||||
router.get('/profile', function(req, res, next) {
|
||||
res.render('profile');
|
||||
});
|
||||
|
||||
//forgot password page
|
||||
router.get('/forgotPassword', function(req, res, next) {
|
||||
res.render('forgotPassword');
|
||||
|
||||
});
|
||||
|
||||
//contact page
|
||||
router.get('/contact', function(req, res, next) {
|
||||
res.render('contact');
|
||||
|
@ -85,6 +85,9 @@
|
||||
<!-- Bootstrap core JavaScript -->
|
||||
<script src="vendor/jquery/jquery.min.js"></script>
|
||||
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="js/learnmore.js"></script>
|
||||
<script src="js/contact.js"></script>
|
||||
<script src="js/search.js"></script>
|
||||
<script src="js/api.js"></script>
|
||||
<script src="js/learnmore.js"></script>
|
||||
<script src="js/search.js"></script>
|
||||
|
@ -1,6 +1,5 @@
|
||||
<%- include('top') %>
|
||||
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;1,300&family=Source+Code+Pro:wght@300&display=swap" rel="stylesheet">
|
||||
|
||||
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
|
||||
integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
@ -112,6 +111,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -24,17 +24,15 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const result = await response.json();
|
||||
|
||||
// Handle the API response
|
||||
//console.log(result);
|
||||
console.log(result);
|
||||
|
||||
if (result.success) {
|
||||
// Form submitted successfully, display notification
|
||||
alert('Form submitted successfully!');
|
||||
location.reload()
|
||||
// You can replace the alert with your custom notification logic
|
||||
} else {
|
||||
// Form submission failed, display error notification
|
||||
alert('Form submission failed. Please try again.');
|
||||
// You can replace the alert with your custom error notification logic
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user