diff --git a/areas.go b/areas.go index 0d58684..f0e9446 100644 --- a/areas.go +++ b/areas.go @@ -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 diff --git a/basket.go b/basket.go index ac6e6e8..8fb88ee 100644 --- a/basket.go +++ b/basket.go @@ -32,7 +32,7 @@ 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) @@ -40,14 +40,14 @@ func authKey(r *Response) { } 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 @@ -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 @@ -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) @@ -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