From cd676d2509938e0e586e76393fc70205790fe843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sat, 19 Apr 2025 20:43:39 +0200 Subject: [PATCH] remove test, fix issues --- server/app.js | 1 - server/homebrew.api.js | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/app.js b/server/app.js index 032cf0852..3b6c7eac0 100644 --- a/server/app.js +++ b/server/app.js @@ -141,7 +141,6 @@ app.get('/', (req, res, next)=>{ title : 'Homepage', description : 'Homepage' }; - console.log(req.account); splitTextStyleAndMetadata(req.brew); return next(); diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 2ab29f31b..da4fe3f06 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -420,6 +420,9 @@ const api = { return true; }, deleteBrew : async (req, res, next)=>{ + + console.log('starting to delete'); + console.log(req.brew); // Delete an orphaned stub if its Google brew doesn't exist try { await api.getBrew('edit')(req, res, ()=>{}); @@ -436,6 +439,7 @@ const api = { let brew = req.brew; const { googleId, editId } = brew; const account = req.account; + //if in local, may test this with: const account = req.account || { username: 'a' }; const isOwner = account && (brew.authors.length === 0 || brew.authors[0] === account.username); // If the user is the owner and the file is saved to google, mark the google brew for deletion const shouldDeleteGoogleBrew = googleId && isOwner;