0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-11 02:32:41 +00:00

Tweak console warning

This commit is contained in:
Trevor Buckner
2022-09-08 22:38:00 -04:00
parent 0625c57824
commit 3c12f1133e

View File

@@ -267,11 +267,12 @@ const deleteGoogleBrew = async (account, id, editId, res)=>{
}; };
const deleteBrew = async (req, res, next)=>{ const deleteBrew = async (req, res, next)=>{
// Delete an orphaned stub if its Google brew doesn't exist
try { try {
await getBrew('edit')(req, res, ()=>{}); await getBrew('edit')(req, res, ()=>{});
} catch (err) { } catch (err) {
const { id, googleId } = getId(req); const { id, googleId } = getId(req);
console.warn(`No google brew found for id ${googleId}, the stub will be deleted.`); console.warn(`No google brew found for id ${googleId}, the stub with id ${id} will be deleted.`);
await HomebrewModel.deleteOne({ editId: id }); await HomebrewModel.deleteOne({ editId: id });
return next(); return next();
} }