saved mock listing

This commit is contained in:
2026-02-04 22:48:57 -07:00
parent a8dda86882
commit 813fbb11b1
13 changed files with 792 additions and 369 deletions
+16 -5
View File
@@ -269,6 +269,8 @@ func (s *accountSubrouter) createMockShop(c *gin.Context) (response.Response, er
// POST /:acctID/platforms/:platform/shops/mocks/:shop-id/listings
func (s *accountSubrouter) addMockListing(c *gin.Context) (response.Response, error) {
acctID := auth.GetIdentity(c).Account.AccountID
var (
platform accounts.Platform
shopID string
@@ -287,11 +289,20 @@ func (s *accountSubrouter) addMockListing(c *gin.Context) (response.Response, er
return nil, err
}
s.log.Debugf("platform: %v", platform)
s.log.Debugf("shopID: %v", shopID)
s.log.Debugf("name: %v", name)
s.log.Debugf("sku: %v", sku)
s.log.Debugf("description: %v", description)
_, err = s.accts.CreateMockListing(
c,
accounts.MockListing{
AccountShopListingIDs: accounts.NewAccountIDs(acctID).
ShopID(platform, shopID).
ListingID(""),
Name: name,
SKU: sku,
Description: description,
},
)
if err != nil {
return nil, fmt.Errorf("failed to create new listing: %w", err)
}
return nil, nil
}