1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Refresh contacts after saving in API

This commit is contained in:
Hillel Coren 2016-06-09 15:20:15 +03:00
parent c5e4707ef5
commit 5e374b2859

View File

@ -53,7 +53,7 @@ class ClientApiController extends BaseAPIController
$query->where('email', $email);
});
}
return $this->listResponse($clients);
}
@ -82,6 +82,9 @@ class ClientApiController extends BaseAPIController
{
$client = $this->clientRepo->save($request->input());
// refresh contacts
$client->load(['contacts']);
return $this->itemResponse($client);
}
@ -112,11 +115,13 @@ class ClientApiController extends BaseAPIController
if ($request->action) {
return $this->handleAction($request);
}
$data = $request->input();
$data['public_id'] = $publicId;
$client = $this->clientRepo->save($data, $request->entity());
$client->load(['contacts']);
return $this->itemResponse($client);
}
@ -146,10 +151,10 @@ class ClientApiController extends BaseAPIController
public function destroy(UpdateClientRequest $request)
{
$client = $request->entity();
$this->clientRepo->delete($client);
return $this->itemResponse($client);
}
}
}