Fixes for vendors

This commit is contained in:
David Bomba 2022-07-22 14:07:51 +10:00
parent 974d614075
commit ace8c64162
2 changed files with 4 additions and 2 deletions

View File

@ -66,6 +66,8 @@ class UpdateVendorRequest extends Request
$input['assigned_user_id'] = $this->decodePrimaryKey($input['assigned_user_id']); $input['assigned_user_id'] = $this->decodePrimaryKey($input['assigned_user_id']);
} }
$input = $this->decodePrimaryKeys($input);
$this->replace($input); $this->replace($input);
} }
} }

View File

@ -32,7 +32,7 @@ class VendorContactRepository extends BaseRepository
} }
/* Get array of IDs which have been removed from the contacts array and soft delete each contact */ /* Get array of IDs which have been removed from the contacts array and soft delete each contact */
$vendor->contacts->pluck('hashed_id')->diff($contacts->pluck('id'))->each(function ($contact) { $vendor->contacts->pluck('id')->diff($contacts->pluck('id'))->each(function ($contact) {
VendorContact::destroy($contact); VendorContact::destroy($contact);
}); });
@ -50,7 +50,7 @@ class VendorContactRepository extends BaseRepository
$update_contact = null; $update_contact = null;
if (isset($contact['id'])) { if (isset($contact['id'])) {
$update_contact = VendorContact::find($this->decodePrimaryKey($contact['id'])); $update_contact = VendorContact::find($contact['id']);
} }
if (! $update_contact) { if (! $update_contact) {