diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-10-13 12:26:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-13 12:26:01 +0200 |
commit | 543b16b4f4bbde4e9857490e2175e44b4d941eb3 (patch) | |
tree | ae73131d19ceccf2514f8fa145c9a612c638cdfa /application/api/controllers/Links.php | |
parent | 8f269b49d7063af5a43021c8775b02d17205a7b5 (diff) | |
parent | b06fc28aa32f477e1785cd998385fdb490bc5ebf (diff) | |
download | Shaarli-543b16b4f4bbde4e9857490e2175e44b4d941eb3.tar.gz Shaarli-543b16b4f4bbde4e9857490e2175e44b4d941eb3.tar.zst Shaarli-543b16b4f4bbde4e9857490e2175e44b4d941eb3.zip |
Merge pull request #1525 from ArthurHoaro/feature/rest-api-bookmark-dates
REST API: allow override of creation and update dates
Diffstat (limited to 'application/api/controllers/Links.php')
-rw-r--r-- | application/api/controllers/Links.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/application/api/controllers/Links.php b/application/api/controllers/Links.php index 29247950..778097fd 100644 --- a/application/api/controllers/Links.php +++ b/application/api/controllers/Links.php | |||
@@ -116,7 +116,7 @@ class Links extends ApiController | |||
116 | public function postLink($request, $response) | 116 | public function postLink($request, $response) |
117 | { | 117 | { |
118 | $data = $request->getParsedBody(); | 118 | $data = $request->getParsedBody(); |
119 | $bookmark = ApiUtils::buildLinkFromRequest($data, $this->conf->get('privacy.default_private_links')); | 119 | $bookmark = ApiUtils::buildBookmarkFromRequest($data, $this->conf->get('privacy.default_private_links')); |
120 | // duplicate by URL, return 409 Conflict | 120 | // duplicate by URL, return 409 Conflict |
121 | if (! empty($bookmark->getUrl()) | 121 | if (! empty($bookmark->getUrl()) |
122 | && ! empty($dup = $this->bookmarkService->findByUrl($bookmark->getUrl())) | 122 | && ! empty($dup = $this->bookmarkService->findByUrl($bookmark->getUrl())) |
@@ -155,7 +155,7 @@ class Links extends ApiController | |||
155 | $index = index_url($this->ci['environment']); | 155 | $index = index_url($this->ci['environment']); |
156 | $data = $request->getParsedBody(); | 156 | $data = $request->getParsedBody(); |
157 | 157 | ||
158 | $requestBookmark = ApiUtils::buildLinkFromRequest($data, $this->conf->get('privacy.default_private_links')); | 158 | $requestBookmark = ApiUtils::buildBookmarkFromRequest($data, $this->conf->get('privacy.default_private_links')); |
159 | // duplicate URL on a different link, return 409 Conflict | 159 | // duplicate URL on a different link, return 409 Conflict |
160 | if (! empty($requestBookmark->getUrl()) | 160 | if (! empty($requestBookmark->getUrl()) |
161 | && ! empty($dup = $this->bookmarkService->findByUrl($requestBookmark->getUrl())) | 161 | && ! empty($dup = $this->bookmarkService->findByUrl($requestBookmark->getUrl())) |