Skip to content
Open

Main #51

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: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
.env
pending.txt
pending-backend.txt
.DS_Store
.DS_Store
/build
/demo-client
/mongo
2 changes: 1 addition & 1 deletion src/middlewares/isCollectionOwner.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports.isCollectionOwner = async (req, res, next) => {
// console.log(collectionId);
try {
const { userId } = await Collection.findById(collectionId);
if (req.userId !== userId) {
if (req.userId.toString() !== userId.toString()) {
return res.status(400).json({
success: false,
message: "You cannot edit, read, or add to this collection",
Expand Down
4 changes: 2 additions & 2 deletions src/models/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const Collection = require('./collection');
const Timeline = require('./timeline');
const User = require('./user');
const CollectionMapping = require('./CollectionMapping');
const CollectionMapping = require('./collectionMapping');


module.exports = {
Collection : Collection,
Timeline : Timeline,
User : User,
CollectionMapping: CollectionMapping,
}
}