mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-22 07:56:57 +00:00
Fix share uncompressing views... again
This commit is contained in:
1 parent
40d120d875
commit
ac2d6fe9a8
1 file changed
+5
-6
@@ -34,18 +34,17 @@ HomebrewSchema.methods.sanatize = function(full=false){
|
|||||||
return brew;
|
return brew;
|
||||||
};
|
};
|
||||||
|
|
||||||
HomebrewSchema.methods.increaseView = function(){
|
HomebrewSchema.methods.increaseView = async function(){
|
||||||
return new Promise((resolve, reject)=>{
|
|
||||||
this.lastViewed = new Date();
|
this.lastViewed = new Date();
|
||||||
this.views = this.views + 1;
|
this.views = this.views + 1;
|
||||||
const text = this.text;
|
const text = this.text;
|
||||||
this.text = undefined;
|
this.text = undefined;
|
||||||
this.save((err)=>{
|
await this.save()
|
||||||
if(err) return reject(err);
|
.catch((err)=>{
|
||||||
return resolve(this);
|
return err;
|
||||||
});
|
});
|
||||||
this.text = text;
|
this.text = text;
|
||||||
});
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
HomebrewSchema.statics.get = function(query){
|
HomebrewSchema.statics.get = function(query){
|
||||||
|
|||||||
Reference in new issue
Block a user