logic(feat) fill new product with off data

This commit is contained in:
Theo Technicguy 2023-08-24 18:04:27 +02:00
parent a9617f4161
commit 6b115b5439
Signed by: theo.technicguy
GPG Key ID: 3BC661201BCA53D9
1 changed files with 5 additions and 0 deletions

View File

@ -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)
}