Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
I
Internship-uksw-2019 api-document-management
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Internship UKSW 2019
Internship-uksw-2019 api-document-management
Commits
9f155e04
Commit
9f155e04
authored
Mar 04, 2020
by
Internship UKSW 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit
parent
36e42f2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
API.js
routes/API.js
+4
-4
No files found.
routes/API.js
View file @
9f155e04
...
@@ -8,7 +8,7 @@ app.use(bodyParser.json())
...
@@ -8,7 +8,7 @@ app.use(bodyParser.json())
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}))
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}))
const
sendEmail
=
(
request
,
response
)
=>
{
const
sendEmail
=
(
request
,
response
)
=>
{
const
{
subject
,
name
,
email
,
message
}
=
request
.
body
const
{
subject
,
name
,
email
,
message
}
=
request
.
body
nodemailer
.
createTestAccount
((
err
,
account
)
=>
{
nodemailer
.
createTestAccount
((
err
,
account
)
=>
{
const
htmlEmail
=
`
const
htmlEmail
=
`
<h3>Contact Details</h3>
<h3>Contact Details</h3>
...
@@ -106,13 +106,13 @@ const deleteRevision = (request, response) => {
...
@@ -106,13 +106,13 @@ const deleteRevision = (request, response) => {
}
}
const
deleteContent
=
(
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
)
{
if
(
error
)
{
throw
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
}
`
)
}
}
)
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment