Skip to content

Commit

Permalink
Merge pull request #450 from jjrom/develop
Browse files Browse the repository at this point in the history
Validate catalog counters
  • Loading branch information
jjrom authored Oct 14, 2024
2 parents 1ab286a + d2455b9 commit f0b5333
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 171 deletions.
2 changes: 1 addition & 1 deletion app/resto/core/RestoConstants.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RestoConstants
// [IMPORTANT] Starting resto 7.x, default routes are defined in RestoRouter class

// resto version
const VERSION = '9.0.0-RC14';
const VERSION = '9.0.0-RC15';

/* ============================================================
* NEVER EVER TOUCH THESE VALUES
Expand Down
7 changes: 4 additions & 3 deletions app/resto/core/api/STACAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,13 @@ public function addCatalog($params, $body)
*/
$body['rtype'] = 'catalog';
$body['id'] = $this->getIdPath($body, $parentId);
$baseUrl = $this->context->core['baseUrl'];

if ($this->catalogsFunctions->getCatalog($body['id'], $this->context->core['baseUrl']) !== null) {
if ($this->catalogsFunctions->getCatalog($body['id'], $baseUrl) !== null) {
RestoLogUtil::httpError(409, 'Catalog ' . $body['id'] . ' already exists');
}
$baseUrl = $this->context->core['baseUrl'];
return RestoLogUtil::success('Catalog added', $this->catalogsFunctions->storeCatalog($body, $this->user->profile['id'], $baseUrl, null, null, false));

return RestoLogUtil::success('Catalog added', $this->catalogsFunctions->storeCatalogs(array($body), $baseUrl, $this->user->profile['id'], null, null, true));

}

Expand Down
Loading

0 comments on commit f0b5333

Please sign in to comment.