fix create account link; more dev data

This commit is contained in:
2026-01-23 20:13:41 -07:00
parent 1509d39373
commit b9464adada
3 changed files with 30 additions and 34 deletions
+2 -8
View File
@@ -287,10 +287,7 @@ func (db *Store) GetUserAndAccountByAccessToken(ctx context.Context, accessToken
func (db *Store) GetShops(ctx context.Context, acctID int64) ([]AccountShop, error) {
var shops []AccountShop
for _, v := range devShops {
if v.AccountID != acctID {
continue
}
for _, v := range getDevShops(acctID) {
shops = append(shops, v)
}
@@ -299,10 +296,7 @@ func (db *Store) GetShops(ctx context.Context, acctID int64) ([]AccountShop, err
func (db *Store) GetListingsForShop(ctx context.Context, acctID int64, platform Platform, shopID string) ([]Listing, error) {
var vs []Listing
for _, v := range devListings {
if v.AccountID != acctID {
continue
}
for _, v := range getDevListings(acctID) {
if v.Platform != platform {
continue
}
+27 -25
View File
@@ -1,11 +1,11 @@
package accounts
var (
devShops = []AccountShop{
func getDevShops(acctID int64) []AccountShop {
return []AccountShop{
AccountShop{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "2",
@@ -15,7 +15,7 @@ var (
AccountShop{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "5",
@@ -25,7 +25,7 @@ var (
AccountShop{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "8",
@@ -35,7 +35,7 @@ var (
AccountShop{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Tiktok,
ShopID: "11",
@@ -45,7 +45,7 @@ var (
AccountShop{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Tiktok,
ShopID: "14",
@@ -55,7 +55,7 @@ var (
AccountShop{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Tiktok,
ShopID: "17",
@@ -65,7 +65,7 @@ var (
AccountShop{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Wix,
ShopID: "20",
@@ -75,7 +75,7 @@ var (
AccountShop{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Wix,
ShopID: "23",
@@ -85,7 +85,7 @@ var (
AccountShop{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Wix,
ShopID: "26",
@@ -93,13 +93,15 @@ var (
Name: "Wix 3",
},
}
}
devListings = []Listing{
func getDevListings(acctID int64) []Listing {
return []Listing{
{
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "2",
@@ -115,7 +117,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "2",
@@ -131,7 +133,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "2",
@@ -147,7 +149,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "2",
@@ -163,7 +165,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "2",
@@ -179,7 +181,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "2",
@@ -195,7 +197,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "5",
@@ -211,7 +213,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "5",
@@ -227,7 +229,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "5",
@@ -243,7 +245,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "5",
@@ -259,7 +261,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "5",
@@ -275,7 +277,7 @@ var (
AccountShopListingIDs: AccountShopListingIDs{
AccountShopIDs: AccountShopIDs{
AccountIDs: AccountIDs{
AccountID: 6,
AccountID: acctID,
},
Platform: Etsy,
ShopID: "5",
@@ -288,4 +290,4 @@ var (
Count: 62,
},
}
)
}