Skip to content
Permalink
Browse files
Error fixing regarding fecthing for applications
  • Loading branch information
skondram committed Nov 28, 2021
1 parent 60636a6 commit 7f1f525d4afdb1b4de26664930ac1efc87f88279
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
@@ -24,7 +24,7 @@ exports.getById = async function getById (id) {

//create a new application in the database
exports.add = async function add (application) {
const query = "INSERT INTO articles SET ?";
const query = "INSERT INTO applications SET ?";
const data = await db.run_query(query, application);
return data;
}
@@ -11,7 +11,7 @@ const router = Router({prefix: '/api/v1/applications'});

// applications routes
router.get('/all', getAll);
router.post('/', bodyParser(), validateApplication, createApplication);
router.post('/all', bodyParser(), validateApplication, createApplication);
router.get('/:id([0-9]{1,})', getById);
router.put('/:id([0-9]{1,})', auth, bodyParser(), validateApplication, updateApplication);
router.del('/:id([0-9]{1,})', auth, deleteApplication);
@@ -35,6 +35,6 @@ module.exports = {
"type": "string",
},
},
"required": ["firstName", "lastName", "email", "address"],
"required": [],
"additionalProperties": false
}

0 comments on commit 7f1f525

Please sign in to comment.