mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 18:22:40 +00:00
Add title trim before new saves and updates
This commit is contained in:
@@ -143,6 +143,7 @@ const api = {
|
|||||||
if(!brew.title) {
|
if(!brew.title) {
|
||||||
brew.title = api.getGoodBrewTitle(brew.text);
|
brew.title = api.getGoodBrewTitle(brew.text);
|
||||||
}
|
}
|
||||||
|
brew.title = brew.title.trim();
|
||||||
|
|
||||||
brew.authors = (account) ? [account.username] : [];
|
brew.authors = (account) ? [account.username] : [];
|
||||||
brew.text = api.mergeBrewText(brew);
|
brew.text = api.mergeBrewText(brew);
|
||||||
@@ -212,6 +213,7 @@ const api = {
|
|||||||
const { saveToGoogle, removeFromGoogle } = req.query;
|
const { saveToGoogle, removeFromGoogle } = req.query;
|
||||||
let afterSave = async ()=>true;
|
let afterSave = async ()=>true;
|
||||||
|
|
||||||
|
brew.title = brew.title.trim();
|
||||||
brew.text = api.mergeBrewText(brew);
|
brew.text = api.mergeBrewText(brew);
|
||||||
|
|
||||||
if(brew.googleId && removeFromGoogle) {
|
if(brew.googleId && removeFromGoogle) {
|
||||||
|
|||||||
Reference in New Issue
Block a user