Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
773 B

7 years ago
7 years ago
7 years ago
7 years ago
  1. //file io
  2. const utils = require('../../utils/utils.js');
  3. //update db
  4. const sql = require('../../utils/sql');
  5. //parse post data
  6. const qs = require('querystring');
  7. module.exports=
  8. {
  9. main: function(postData)
  10. {
  11. return new Promise(function(resolve, reject)
  12. {
  13. Promise.all([utils.include("./admin/category/addCategory.html"),
  14. printCategories(),
  15. processPost(postData)]).then(function(html)
  16. {
  17. resolve("<div class=\"col-md-6\">" +
  18. html.join('') +
  19. "</div></div>");
  20. }).catch(function(error)
  21. {
  22. console.log("error in addCategory.js");
  23. reject(error);
  24. })
  25. });
  26. }
  27. };