mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 20:52:40 +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)=>{
|
.then((brew)=>{
|
||||||
if(!brew) // No document found
|
if(!brew) // No document found
|
||||||
return res.status(404).json({ error: 'Document not 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);
|
return res.json(brew);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err)=>{
|
.catch((err)=>{
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user