mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
return an error if trying to pop the last update from a pack
This commit is contained in:
parent
24701219ff
commit
4c0eea9916
1 changed files with 4 additions and 1 deletions
|
@ -10,7 +10,10 @@ module.exports = MongoManager =
|
|||
.limit(1)
|
||||
.toArray (error, compressedUpdates) ->
|
||||
return callback(error) if error?
|
||||
return callback null, null if compressedUpdates[0]?.pack? # cannot pop from a pack
|
||||
if compressedUpdates[0]?.pack?
|
||||
# cannot pop from a pack, throw error
|
||||
error = new Error("last compressed update is a pack")
|
||||
return callback error, null
|
||||
return callback null, compressedUpdates[0] or null
|
||||
|
||||
deleteCompressedUpdate: (id, callback = (error) ->) ->
|
||||
|
|
Loading…
Reference in a new issue