Skip to content

Commit

Permalink
fix(category): trim category name
Browse files Browse the repository at this point in the history
  • Loading branch information
ncarlier committed Nov 14, 2022
1 parent eb0b7e9 commit 18183cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/db/postgres/category.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (pg *DB) CreateCategoryForUser(uid uint, form model.CategoryCreateForm) (*m
"user_id", "title",
).Values(
uid,
form.Title,
strings.TrimSpace(form.Title),
).Suffix(
"RETURNING " + strings.Join(categoryColumns, ","),
).ToSql()
Expand All @@ -57,7 +57,7 @@ func (pg *DB) UpdateCategoryForUser(uid uint, form model.CategoryUpdateForm) (*m
"updated_at": "NOW()",
}
if form.Title != nil {
update["title"] = *form.Title
update["title"] = strings.TrimSpace(*form.Title)
}
query, args, _ := pg.psql.Update(
"categories",
Expand Down

0 comments on commit 18183cf

Please sign in to comment.