diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index 57fc5f457..1e051987b 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -28,7 +28,6 @@ const UserPage = createClass({ const usernameWithS = this.props.username + (this.props.username.endsWith('s') ? `’` : `’s`); const brews = _.groupBy(this.props.brews, (brew)=>{ - brew.title = brew.title.trim(); return (brew.published ? 'published' : 'private'); }); diff --git a/server/app.js b/server/app.js index 520dd154e..f10b6ff5e 100644 --- a/server/app.js +++ b/server/app.js @@ -268,6 +268,9 @@ app.get('/user/:username', async (req, res, next)=>{ } req.brews = _.map(brews, (brew)=>{ + // Clean up brew data + brew.title = brew.title?.trim(); + brew.description = brew.description?.trim(); return sanitizeBrew(brew, ownAccount ? 'edit' : 'share'); });