Apply the "only" method to the providers controller

This commit is contained in:
Alex Tselegidis 2022-06-27 11:27:46 +03:00
parent 680d01d16f
commit 8fde7e5221

View file

@ -136,6 +136,23 @@ class Providers extends EA_Controller {
$provider = request('provider');
$this->providers_model->only($provider, [
'first_name',
'last_name',
'email',
'alt_number',
'phone_number',
'address',
'city',
'state',
'zip_code',
'notes',
'is_private',
'id_roles',
'settings',
'services',
]);
$provider_id = $this->providers_model->save($provider);
$provider = $this->providers_model->find($provider_id);
@ -167,6 +184,24 @@ class Providers extends EA_Controller {
$provider = request('provider');
$this->providers_model->only($provider, [
'id',
'first_name',
'last_name',
'email',
'alt_number',
'phone_number',
'address',
'city',
'state',
'zip_code',
'notes',
'is_private',
'id_roles',
'settings',
'services',
]);
$provider_id = $this->providers_model->save($provider);
$provider = $this->providers_model->find($provider_id);