counter: update model to reflect that the ID may be null

This commit is contained in:
Chris Sexton 2022-07-17 13:48:12 -04:00
parent 3f7598e92c
commit aa7d377c08
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ type Item struct {
Nick string Nick string
Item string Item string
Count int Count int
UserID string UserID sql.NullString
} }
type alias struct { type alias struct {
@ -190,7 +190,7 @@ func GetUserItem(db *sqlx.DB, nick, id, itemName string) (Item, error) {
item.ID = -1 item.ID = -1
item.Nick = nick item.Nick = nick
item.Item = itemName item.Item = itemName
item.UserID = id item.UserID.String = id
case nil: case nil:
default: default:
return Item{}, err return Item{}, err