Skip to content

Commit

Permalink
bug fix + implement suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
LocalNewsTV committed Oct 12, 2023
1 parent 7da0694 commit 11111bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/src/controllers/collection-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const updateCollection = async function(incomingObj, collectionId, displayName)
let arrayOfObjIds = [];

for(const record of incomingObj.records){
if(recordIds.includes(record)){
if(!recordIds.includes(record)){
recordsToAdd.push(record);
arrayOfObjIds.push(new ObjectId(record));
}
Expand Down
2 changes: 1 addition & 1 deletion api/test/factories/factory_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function hexaDecimal(count) {

function generateSeededObjectId(value) {
let oid = (typeof value === "undefined") ? hexaDecimal(24).toLocaleLowerCase() : value;
if (!bsonObjectId.isValid(oid)) throw new Error("Invalid attempt to generate an ObjectID: '" + oid + "'");
if (!bsonObjectId.isValid(oid)) throw new Error(`Invalid attempt to generate an ObjectID: ${oid}`);
return mongTypes.ObjectId(oid);
}

Expand Down

0 comments on commit 11111bb

Please sign in to comment.