Added notes field to transformers

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-03-03 20:29:35 -08:00
parent 9acb5413f6
commit 6fca8350f9
2 changed files with 2 additions and 0 deletions

View file

@ -43,6 +43,7 @@ class ComponentsTransformer
'id' => (int) $component->company->id,
'name' => e($component->company->name)
] : null,
'notes' => ($component->notes) ? e($component->notes) : null,
'created_at' => Helper::getFormattedDateObject($component->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($component->updated_at, 'datetime'),
'user_can_checkout' => ($component->numRemaining() > 0) ? 1 : 0,

View file

@ -37,6 +37,7 @@ class ConsumablesTransformer
'purchase_cost' => Helper::formatCurrencyOutput($consumable->purchase_cost),
'purchase_date' => Helper::getFormattedDateObject($consumable->purchase_date, 'date'),
'qty' => (int) $consumable->qty,
'notes' => ($consumable->notes) ? e($consumable->notes) : null,
'created_at' => Helper::getFormattedDateObject($consumable->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($consumable->updated_at, 'datetime'),
];