Compare commits

..

2 Commits

Author SHA1 Message Date
2c4e661b9d Merge pull request 'fix callback function' (#7) from dev into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #7
2023-02-17 22:37:24 +01:00
Artem Anufrij
4aea43a8bb fix callback function
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-02-17 22:36:34 +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]);
}) })
} }
}); });