From a41553637ac1335f260f7ed3a32dedf8664722ed Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 29 Jun 2023 16:43:30 +1200 Subject: [PATCH] Add trim to brew description --- server/homebrew.api.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 434447ec9..1e754a5ea 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -143,12 +143,14 @@ const api = { if(!brew.title) { brew.title = api.getGoodBrewTitle(brew.text); } - brew.title = brew.title.trim(); brew.authors = (account) ? [account.username] : []; brew.text = api.mergeBrewText(brew); _.defaults(brew, DEFAULT_BREW); + + brew.title = brew.title.trim(); + brew.description = brew.description.trim(); }, newGoogleBrew : async (account, brew, res)=>{ const oAuth2Client = GoogleActions.authCheck(account, res); @@ -214,6 +216,7 @@ const api = { let afterSave = async ()=>true; brew.title = brew.title.trim(); + brew.description = brew.description.trim() || ''; brew.text = api.mergeBrewText(brew); if(brew.googleId && removeFromGoogle) {