Skip to content

Commit

Permalink
What does this PR do?
Browse files Browse the repository at this point in the history
  Add the 'tag articles feature'

Tasks to be accomplished

  - Implement article Tagging
  - Add article search by tag
  - Add orpahn and article tag modification
  - Add tag deletion
  - Add creation of individual tags
  - Add fetching all tags of a given article
  - Add deletion of a specific tag of a specific article

How to manually test

  On postman, send the following requests using the appropriate base url as
http://localhost:port/api/v1 for local testing and https://https://codepirates-ah-backend.herokuapp.com/api/v1
for remote testing
  - Tag creation:
    post/baseUrl/api/v1/tags request with a body {name: Your tag name}
  - Tagging an article:
    post/baseUrl/articles/:articleId/:your-tag-name
  - Updating a tag:
    patch/base-url/tags/:old tag name with a body {update: new tag name}
  - Updating a specific tag of an article:
    patch/articles/:articleId/:tagName with a body {name: tagName}
  - Getting all articles with a given tag:
    get/tags/:tagName/articles
  - Getting all tags of a given article:
    get/articles/:articleId/tags
  - Getting all tags:
    get/tags
  - Deleting a tag:
    delete/tags/:tagName
  - Deleting a specific tag of a specific article
    delete/articles/:articleId/:tagName

PT story:

  [#167313411](https://www.pivotaltracker.com/story/show/167313411)
  • Loading branch information
Anguandia committed Aug 22, 2019
1 parent 8c96a9c commit 3532a00
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = (sequelize, DataTypes) => {
targetKey: 'id',
onUpdate: 'CASCADE',
onDelete: 'CASCADE'
})
});
Article.belongsToMany(models.Tag, {
through: 'ArticleTags',
foreignKey: 'articleId',
Expand Down
Empty file removed src/routes/api/article/doc.js
Empty file.

0 comments on commit 3532a00

Please sign in to comment.