0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-26 16:02:38 +00:00

Add title trim before new saves and updates

This commit is contained in:
G.Ambatte
2023-06-29 16:35:26 +12:00
parent 4ded080a58
commit 636f2f9372

View File

@@ -143,6 +143,7 @@ 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);
@@ -212,6 +213,7 @@ const api = {
const { saveToGoogle, removeFromGoogle } = req.query;
let afterSave = async ()=>true;
brew.title = brew.title.trim();
brew.text = api.mergeBrewText(brew);
if(brew.googleId && removeFromGoogle) {