FIX: Agregar o editar producto

This commit is contained in:
2020-05-29 20:00:40 -04:00
parent 88df2f547a
commit 4796639b2e
4 changed files with 20 additions and 5 deletions

View File

@ -136,7 +136,7 @@ class Producto extends Model {
return $this->imagen;
}
public function map($data): Model {
$this->id = $data->id;
$this->id = $data->id ?? null;
$this->nombre = $data->nombre;
$this->segmento = $data->segmento;
$this->direccion = new Direccion();