fix callback function #7

Merged
artem merged 1 commits from dev into main 2023-02-17 22:37:24 +01:00
3 changed files with 4 additions and 4 deletions

View File

@ -126,7 +126,7 @@ router.route("/:id/share")
if (result == null) { if (result == null) {
let item = { let item = {
user_id: req.user._id, user_id: req.user._id,
object_id: new ObjectId(album_id), object_id: album._id,
type: "album", type: "album",
cover: album.covers.cover32 cover: album.covers.cover32
} }

View File

@ -128,7 +128,7 @@ router.route("/:id/share")
if (result == null) { if (result == null) {
let item = { let item = {
user_id: req.user._id, user_id: req.user._id,
object_id: new ObjectId(box_id), object_id: box._id,
type: "box", type: "box",
cover: box.covers.cover32 cover: box.covers.cover32
} }

View File

@ -56,7 +56,7 @@ exports.exists = function (object_id, callback) {
dbo.collection("shares") dbo.collection("shares")
.findOne({ object_id: ObjectId(object_id) }) .findOne({ object_id: ObjectId(object_id) })
.then(result => { .then(result => {
cp(callback, result); cb(callback, result);
}); });
} }
@ -75,7 +75,7 @@ exports.add = function (item, callback) {
]) ])
.toArray((err, result) => { .toArray((err, result) => {
if (err) throw err; if (err) throw err;
cp(callback, result[0]); cb(callback, result[0]);
}) })
} }
}); });