Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
booscaaa committed May 11, 2022
1 parent 0760450 commit f25fb80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion adapter/postgres/item_repository/update_item_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (db *itemRepository) Update(id int, date time.Time, name, description, init

err := db.database.QueryRow(
ctx,
"UPDATE item SET name = $1, description = $2, date = to_timestamp($3, 'YYYY-MM-DD HH24:MI:SS'), initials = $4 WHERE id = $5",
"UPDATE item SET name = $1, description = $2, date = $3, initials = $4 WHERE id = $5 returning *",
name, description, date, initials, id,
).Scan(
&idA,
Expand Down
2 changes: 1 addition & 1 deletion core/item/update_item_usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

func (usecase *itemUseCase) Update(i domain.Item) (*domain.Item, error) {
item, err := usecase.repository.Update(i.ID, i.Date, i.Description, i.Name, i.Initials)
item, err := usecase.repository.Update(i.ID, i.Date, i.Name, i.Description, i.Initials)

if err != nil {
return nil, err
Expand Down

0 comments on commit f25fb80

Please sign in to comment.