Skip to content

Commit f0b5333

Browse files
authored
Merge pull request #450 from jjrom/develop
Validate catalog counters
2 parents 1ab286a + d2455b9 commit f0b5333

File tree

5 files changed

+182
-171
lines changed

5 files changed

+182
-171
lines changed

app/resto/core/RestoConstants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RestoConstants
2020
// [IMPORTANT] Starting resto 7.x, default routes are defined in RestoRouter class
2121

2222
// resto version
23-
const VERSION = '9.0.0-RC14';
23+
const VERSION = '9.0.0-RC15';
2424

2525
/* ============================================================
2626
* NEVER EVER TOUCH THESE VALUES

app/resto/core/api/STACAPI.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,13 @@ public function addCatalog($params, $body)
392392
*/
393393
$body['rtype'] = 'catalog';
394394
$body['id'] = $this->getIdPath($body, $parentId);
395+
$baseUrl = $this->context->core['baseUrl'];
395396

396-
if ($this->catalogsFunctions->getCatalog($body['id'], $this->context->core['baseUrl']) !== null) {
397+
if ($this->catalogsFunctions->getCatalog($body['id'], $baseUrl) !== null) {
397398
RestoLogUtil::httpError(409, 'Catalog ' . $body['id'] . ' already exists');
398399
}
399-
$baseUrl = $this->context->core['baseUrl'];
400-
return RestoLogUtil::success('Catalog added', $this->catalogsFunctions->storeCatalog($body, $this->user->profile['id'], $baseUrl, null, null, false));
400+
401+
return RestoLogUtil::success('Catalog added', $this->catalogsFunctions->storeCatalogs(array($body), $baseUrl, $this->user->profile['id'], null, null, true));
401402

402403
}
403404

0 commit comments

Comments
 (0)