Enable editing of supplier products and listing services connected to them

This commit is contained in:
Deon George
2022-06-30 23:51:20 +10:00
parent fb416306e7
commit 5297ae8a62
33 changed files with 963 additions and 182 deletions

View File

@@ -183,11 +183,10 @@ class Product extends Model implements IDs
* Return the type of service is provided. eg: Broadband, Phone.
*
* @return string
* @todo Does type need to be a mandatory attribute on a model - then we can remove this condition
*/
public function getCategoryAttribute(): string
{
return $this->type ? $this->type->getCategoryAttribute() : 'generic';
return $this->supplied->getCategoryAttribute();
}
/**
@@ -195,11 +194,10 @@ class Product extends Model implements IDs
* other logic of these types.
*
* @return string
* @todo Does type need to be a mandatory attribute on a model - then we can remove this condition
*/
public function getCategoryNameAttribute(): string
{
return $this->type ? $this->type->getCategoryNameAttribute() : 'Generic';
return $this->supplied->getCategoryNameAttribute();
}
/**