Commit 9f155e04 authored by Internship UKSW 2019's avatar Internship UKSW 2019

Initial commit

parent 36e42f2e
......@@ -8,7 +8,7 @@ app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: false }))
const sendEmail = (request, response) => {
const { subject, name, email, message } = request.body
const {subject, name, email, message} = request.body
nodemailer.createTestAccount((err, account) => {
const htmlEmail = `
<h3>Contact Details</h3>
......@@ -106,13 +106,13 @@ const deleteRevision = (request, response) => {
}
const deleteContent = (request, response) => {
const {doc_id} = request.body
const {cont_id} = request.body
pool.query('DELETE FROM content WHERE doc_id = $1', [doc_id], (error, results) => {
pool.query('DELETE FROM content WHERE cont_id = $1', [cont_id], (error, results) => {
if (error) {
throw error
}
response.status(200).send(`Content deleted with doc_id: ${doc_id}`)
response.status(200).send(`Content deleted with cont_id: ${cont_id}`)
}
)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment