logic(feat) fill new product with off data
This commit is contained in:
parent
a9617f4161
commit
6b115b5439
|
@ -30,6 +30,11 @@ func (l *logic) checkProductExists(id uint) (*types.Product, error) {
|
|||
|
||||
func (l *logic) CreateProduct(product *types.Product) (err error) {
|
||||
logger.Trace().Any("product", product).Msg("creating product")
|
||||
|
||||
if err := fillBlankFields(product); err != nil {
|
||||
logger.Warn().Any("product", product).Err(err).Msg("error updating data")
|
||||
}
|
||||
|
||||
return l.dsrc.InsertProduct(product)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue