Skip to content

Commit

Permalink
#164796892-feature: implement Article Rating
Browse files Browse the repository at this point in the history
Complete Article rating feature

[#164796892]
  • Loading branch information
micah-akpan committed Apr 17, 2019
1 parent 4e2988b commit ffebedb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/middlewares/articles.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import Sequelize from 'sequelize';
import {
validateArticle,
import {
validateArticle,
getArticleReportValidator,
validateArticleTag,
validateArticleRating,
isOwnArticle,
isOwnArticle,
} from '../utils/article';
import { findById } from '../utils/query';
import { Article } from '../models';
import {
parseErrorResponse,
sendResponse,
createErrorResponse,
responseHandler
sendResponse,
createErrorResponse,
responseHandler
} from '../utils';

/**
Expand Down
3 changes: 1 addition & 2 deletions src/models/article_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export default (sequelize, DataTypes) => {
},
{
tableName: 'article_reports',
}
);
});
Report.associate = (models) => {
Report.belongsTo(models.Article, {
foreignKey: 'articleId',
Expand Down
2 changes: 1 addition & 1 deletion src/routers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import articleValidation, {
isAuthor,
articleReportValidation,
articleTagValidation,
validateRating,
validateRating,
checkIfAuthoredBySameUser
} from '../middlewares/articles';
import { checkParam } from '../middlewares/checkParam';
Expand Down

0 comments on commit ffebedb

Please sign in to comment.