Skip to content

Commit e3f61d8

Browse files
committed
touched up
1 parent 429cab8 commit e3f61d8

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

config/config.js

Whitespace-only changes.

controllers/blog-post.controller.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { blogService } = require('../services')
33
const { createBlogpost } = blogService
44

55
/*
6-
* call other services, or service functions here if you need to
6+
* call other imported services, or same service but different functions here if you need to
77
*/
88
const postBlogpost = async (req, res, next) => {
99
const {user, content} = req.body
@@ -15,7 +15,7 @@ const postBlogpost = async (req, res, next) => {
1515
next()
1616
} catch(e) {
1717
console.log(e.message)
18-
res.send(500) && next(error)
18+
res.sendStatus(500) && next(error)
1919
}
2020
}
2121

db/blog-post.db.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const { getConnection } = require('../config')
2+
13
const blogpostDb = (user, content) => {
24
/*
35
* put code to call database here
@@ -11,4 +13,4 @@ const blogpostDb = (user, content) => {
1113

1214
module.exports = {
1315
blogpostDb
14-
}
16+
}

services/blog-post.service.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { blogpostDb } = require('../db')
22

33
/*
44
* if you need to make calls to additional tables, data stores (Redis, for example),
5-
* or call another endpoint as part of creating the blogpost, add them to this service
5+
* or call an external endpoint as part of creating the blogpost, add them to this service
66
*/
77
const createBlogpost = async (user, content) => {
88
try {

0 commit comments

Comments
 (0)