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