0
0
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:
G.Ambatte
2024-10-13 13:44:33 +13:00
parent 6d4b1843ae
commit ccafee7a21

View File

@@ -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);