Skip to content

Commit

Permalink
update readme for 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ezy committed Jul 23, 2018
1 parent a1a9ec9 commit 3f43eb0
Show file tree
Hide file tree
Showing 4 changed files with 1,077 additions and 2,629 deletions.
52 changes: 35 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,42 @@ Seedpress is a headless Node JS API server built with Express, for PostgreSQL us
* [X] Authentication with JSON Web Token
* [X] Email, Password validations
* [X] User login and registration
* [X] API and Unit testing
* [X] Page, Post, Media and Tag models
* [X] Full API and Unit test coverage
* [X] Page and Term models with belongsToMany two way relationship
* [X] Easily deployable to Heroku (Procfile)

### Schema

* Post
* id
* postTitle
* postSlug
* postType
* postDate
* postContent
* postAuthor
* postImage
* postMedia
* postStatus
* postExpiry
* postFrequency
* postTerms
* createdAt
* updatedAt

* Terms
* id
* termType
* termName
* createdAt
* updatedAt

* PostTerms
* termId
* postId
* createdAt
* updatedAt

### To run locally

Make sure to install and run PostgreSQL first. There are a list of package.json
Expand All @@ -57,7 +89,7 @@ yarn test
#### Postman

There is a postman collection file for API testing and development in
`test/newseed-api.postman_collection.json`. It contains scripts and
`test/seedpress-api.postman_collection.json`. It contains scripts and
basic CRUD for:

* /auth
Expand All @@ -71,20 +103,6 @@ basic CRUD for:
* [GET] All posts (/)
* [GET] Single post (/:slug)

* /pages
* [POST] Single page (/ - with auth)
* [PATCH] Single page (/:slug - with auth)
* [DEL] Single page (/:slug - with auth)
* [GET] All pages (/)
* [GET] Single page (/:slug)

* /media
* [POST] Single medium (/ - with auth)
* [PATCH] Single medium (/:slug - with auth)
* [DEL] Single medium (/:slug - with auth)
* [GET] All media (/)
* [GET] Single medium (/:slug)

### To deploy on Heroku
```
heroku login
Expand Down
6 changes: 3 additions & 3 deletions server/api/post/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ function updatePost(req, res) {
if (!post.dataValues.postSlug.includes(newTitle)) {
req.body.postSlug = `${newTitle}-${Date.now()}`;
}
return post.uppostDateAttributes(req.body);
return post.updateAttributes(req.body);
})
.then((uppostDatedPost) => {
res.json(uppostDatedPost);
.then((updatedPost) => {
res.json(updatedPost);
})
.catch((err) => res.status(400).send({
error: err.message
Expand Down
Loading

0 comments on commit 3f43eb0

Please sign in to comment.