Skip to content

Commit

Permalink
fix: Not retrieving the Wii Number
Browse files Browse the repository at this point in the history
  • Loading branch information
noahpistilli committed Nov 25, 2024
1 parent 7678891 commit 74bbbf2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion areas.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func areaList(r *Response) {
}

newAreaCode := GenerateAreaCode(areaCode)
_, err := pool.Exec(context.Background(), InsertUser, newAreaCode, r.request.Header.Get("X-WiiID"))
_, err := pool.Exec(context.Background(), InsertUser, newAreaCode, r.wiiNumber.GetHollywoodID())
if err != nil {
r.ReportError(err)
return
Expand Down
12 changes: 6 additions & 6 deletions basket.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ func authKey(r *Response) {

// First we query to determine if the user already has an auth key. If they do, reset the basket.
var authExists bool
row := pool.QueryRow(context.Background(), DoesAuthKeyExist, r.request.Header.Get("X-WiiID"))
row := pool.QueryRow(context.Background(), DoesAuthKeyExist, r.wiiNumber.GetHollywoodID())
err = row.Scan(&authExists)
if err != nil {
r.ReportError(err)
return
}

if authExists {
_, err = pool.Exec(context.Background(), ClearBasket, "", "", "[]", r.request.Header.Get("X-WiiID"))
_, err = pool.Exec(context.Background(), ClearBasket, "", "", "[]", r.wiiNumber.GetHollywoodID())
if err != nil {
r.ReportError(err)
return
}
}

_, err = pool.Exec(context.Background(), InsertAuthkey, authKeyValue.String(), r.request.Header.Get("X-WiiID"))
_, err = pool.Exec(context.Background(), InsertAuthkey, authKeyValue.String(), r.wiiNumber.GetHollywoodID())
if err != nil {
r.ReportError(err)
return
Expand All @@ -62,7 +62,7 @@ func authKey(r *Response) {
}

func basketReset(r *Response) {
_, err := pool.Exec(context.Background(), ClearBasket, "", "", "[]", r.request.Header.Get("X-WiiID"))
_, err := pool.Exec(context.Background(), ClearBasket, "", "", "[]", r.wiiNumber.GetHollywoodID())
if err != nil {
r.ReportError(err)
return
Expand All @@ -77,7 +77,7 @@ func basketDelete(r *Response) {
}

var lastBasket string
row := pool.QueryRow(context.Background(), QueryUserBasket, r.request.Header.Get("X-WiiID"))
row := pool.QueryRow(context.Background(), QueryUserBasket, r.wiiNumber.GetHollywoodID())
err = row.Scan(&lastBasket, nil)
if err != nil {
r.ReportError(err)
Expand All @@ -101,7 +101,7 @@ func basketDelete(r *Response) {
return
}

_, err = pool.Exec(context.Background(), UpdateUserBasket, jsonStr, r.request.Header.Get("X-WiiID"))
_, err = pool.Exec(context.Background(), UpdateUserBasket, jsonStr, r.wiiNumber.GetHollywoodID())
if err != nil {
r.ReportError(err)
return
Expand Down

0 comments on commit 74bbbf2

Please sign in to comment.