This commit is contained in:
parent
50c682e31f
commit
f984acea9b
@ -143,7 +143,8 @@ router.route("/:id/share")
|
|||||||
let album_id = req.params.id
|
let album_id = req.params.id
|
||||||
if (req.user.roles.indexOf("admin") > -1) {
|
if (req.user.roles.indexOf("admin") > -1) {
|
||||||
let item = {
|
let item = {
|
||||||
object_id: new ObjectId(album_id)
|
object_id: new ObjectId(album_id),
|
||||||
|
type: "album"
|
||||||
}
|
}
|
||||||
database.share.delete(item, () => {
|
database.share.delete(item, () => {
|
||||||
res.status(200).end();
|
res.status(200).end();
|
||||||
|
@ -145,7 +145,8 @@ router.route("/:id/share")
|
|||||||
let box_id = req.params.id
|
let box_id = req.params.id
|
||||||
if (req.user.roles.indexOf("admin") > -1) {
|
if (req.user.roles.indexOf("admin") > -1) {
|
||||||
let item = {
|
let item = {
|
||||||
object_id: new ObjectId(box_id)
|
object_id: new ObjectId(box_id),
|
||||||
|
type: "box"
|
||||||
}
|
}
|
||||||
database.share.delete(item, () => {
|
database.share.delete(item, () => {
|
||||||
res.status(200).end();
|
res.status(200).end();
|
||||||
|
@ -22,21 +22,18 @@ exports.byId = function (id, callback) {
|
|||||||
if (result) {
|
if (result) {
|
||||||
switch (result.type) {
|
switch (result.type) {
|
||||||
case "album":
|
case "album":
|
||||||
console.log(result.type);
|
|
||||||
database.albums.byId(result.object_id, undefined, (album) => {
|
database.albums.byId(result.object_id, undefined, (album) => {
|
||||||
result.object = album;
|
result.object = album;
|
||||||
cb(callback, result);
|
cb(callback, result);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "box":
|
case "box":
|
||||||
console.log(result.type);
|
|
||||||
database.boxes.byId(result.object_id, undefined, (box) => {
|
database.boxes.byId(result.object_id, undefined, (box) => {
|
||||||
result.object = box;
|
result.object = box;
|
||||||
cb(callback, result);
|
cb(callback, result);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log(result.type);
|
|
||||||
cb(callback, result);
|
cb(callback, result);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user