Add callback and update user role
This commit is contained in:
@@ -45,6 +45,16 @@ func (b *ProductRepository) GetProductByID(ctx context.Context, id int64) (*enti
|
||||
return product, nil
|
||||
}
|
||||
|
||||
func (b *ProductRepository) GetProductByPartnerIDAndSiteID(ctx context.Context, partnerID, siteID int64) (entity.ProductList, error) {
|
||||
var products []*entity.ProductDB
|
||||
if err := b.db.WithContext(ctx).Where("partner_id = ? AND site_id = ?", partnerID, siteID).Find(&products).Error; err != nil {
|
||||
logger.ContextLogger(ctx).Error("error when finding product by partner ID and site id", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return products, nil
|
||||
}
|
||||
|
||||
func (b *ProductRepository) GetAllProducts(ctx context.Context, req entity.ProductSearch) (entity.ProductList, int, error) {
|
||||
var products []*entity.ProductDB
|
||||
var total int64
|
||||
|
||||
Reference in New Issue
Block a user