From f96c0387a22cc99cc84ba30ff3b107954e3df25b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 27 Mar 2017 11:43:47 +0300 Subject: [PATCH] Fixes for contact API --- app/Policies/ContactPolicy.php | 7 +++++ app/Services/ContactService.php | 51 +++++++++++++++++++++++++++++++++ docs/configure.rst | 2 ++ 3 files changed, 60 insertions(+) create mode 100644 app/Policies/ContactPolicy.php create mode 100644 app/Services/ContactService.php diff --git a/app/Policies/ContactPolicy.php b/app/Policies/ContactPolicy.php new file mode 100644 index 000000000000..2aab428a006f --- /dev/null +++ b/app/Policies/ContactPolicy.php @@ -0,0 +1,7 @@ +contactRepo = $contactRepo; + } + + /** + * @return ContactRepository + */ + protected function getRepo() + { + return $this->contactRepo; + } + + /** + * @param $data + * @param null $contact + * + * @return mixed|null + */ + public function save($data, $contact = null) + { + if (isset($data['client_id']) && $data['client_id']) { + $data['client_id'] = Client::getPrivateId($data['client_id']); + } + + return $this->contactRepo->save($data, $contact); + } + +} diff --git a/docs/configure.rst b/docs/configure.rst index 652294ffd92f..31fbc989a36f 100644 --- a/docs/configure.rst +++ b/docs/configure.rst @@ -59,6 +59,8 @@ If you require contacts to enter a password to see their invoice you'll need to You can install PhantomJS to generate the PDF locally, to enable it add ``PHANTOMJS_BIN_PATH=/usr/local/bin/phantomjs``. +We suggest using version >= 2.1.1, users have reported seeing 'Error: 0' with older versions. + .. TIP:: To determine the path you can run ``which phantomjs`` from the command line. Custom Fonts