fix callback function #7
@ -126,7 +126,7 @@ router.route("/:id/share")
 | 
			
		||||
          if (result == null) {
 | 
			
		||||
            let item = {
 | 
			
		||||
              user_id: req.user._id,
 | 
			
		||||
              object_id: new ObjectId(album_id),
 | 
			
		||||
              object_id: album._id,
 | 
			
		||||
              type: "album",
 | 
			
		||||
              cover: album.covers.cover32
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -128,7 +128,7 @@ router.route("/:id/share")
 | 
			
		||||
          if (result == null) {
 | 
			
		||||
            let item = {
 | 
			
		||||
              user_id: req.user._id,
 | 
			
		||||
              object_id: new ObjectId(box_id),
 | 
			
		||||
              object_id: box._id,
 | 
			
		||||
              type: "box",
 | 
			
		||||
              cover: box.covers.cover32
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -56,7 +56,7 @@ exports.exists = function (object_id, callback) {
 | 
			
		||||
  dbo.collection("shares")
 | 
			
		||||
    .findOne({ object_id: ObjectId(object_id) })
 | 
			
		||||
    .then(result => {
 | 
			
		||||
      cp(callback, result);
 | 
			
		||||
      cb(callback, result);
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -75,7 +75,7 @@ exports.add = function (item, callback) {
 | 
			
		||||
          ])
 | 
			
		||||
          .toArray((err, result) => {
 | 
			
		||||
            if (err) throw err;
 | 
			
		||||
            cp(callback, result[0]);
 | 
			
		||||
            cb(callback, result[0]);
 | 
			
		||||
          })
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user