mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 16:22:44 +00:00
Get text from textBin in brew object
This commit is contained in:
@@ -76,8 +76,12 @@ router.get('/admin/lookup/:id', mw.adminOnly, async (req, res, next)=>{
|
||||
.then((brew)=>{
|
||||
if(!brew) // No document found
|
||||
return res.status(404).json({ error: 'Document not found' });
|
||||
else
|
||||
else {
|
||||
if(!brew.text && brew.textBin){
|
||||
brew.text = zlib.inflateRawSync(brew.textBin);
|
||||
}
|
||||
return res.json(brew);
|
||||
}
|
||||
})
|
||||
.catch((err)=>{
|
||||
console.error(err);
|
||||
|
||||
Reference in New Issue
Block a user