Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ engines:
config: .eslintrc
duplication:
enabled: true
checks:
Similar code:
enabled: false
config:
languages:
- javascript
Expand All @@ -18,3 +21,5 @@ ratings:
exclude_paths:
- node_modules/**/*
- tests/*
- server/models
- server/migrations
6 changes: 3 additions & 3 deletions server/controllers/documents.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import models from '../models';
import { documentCreator, isAdmin, isUser } from '../helpers/helper';
import { documentCreator, isUser } from '../helpers/helper';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to resolve path to module '../helpers/helper' import/no-unresolved
Missing file extension for "../helpers/helper" import/extensions

import paginate from '../helpers/paginate';

const Document = models.Document;
Expand Down Expand Up @@ -81,7 +81,7 @@ export default {
update(req, res) {
Document.findById(req.params.id)
.then((document) => {
if (!isAdmin(req.user.id) && !isUser(document.userId, req.user.id)) {
if (!isUser(document.userId, req.user.id)) {
return res.status(401).send({
message: "Unauthorised user. You don't have permission to update this document"
});
Expand Down Expand Up @@ -121,7 +121,7 @@ export default {
delete(req, res) {
Document.findById(req.params.id)
.then((document) => {
if (!isAdmin(req.user.id) && !isUser(document.userId, req.user.id)) {
if (!isUser(document.userId, req.user.id)) {
return res.status(401).send({
message: "Unauthorised user. You don't have permission to delete this document"
});
Expand Down
Loading