mirror of https://github.com/velour/catbase.git
counter: update model to reflect that the ID may be null
This commit is contained in:
parent
3f7598e92c
commit
aa7d377c08
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue