saved mock listing
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user