adsasd
This commit is contained in:
@@ -1094,9 +1094,23 @@ class ApiKernel
|
||||
$auth = $this->requireAuth();
|
||||
$customerId = (int)($auth['customer_id'] ?? 0);
|
||||
$defaults = $this->resolveLegacySectionDefaults($kind);
|
||||
$section = $defaults['is_template']
|
||||
? $this->ensureEmailtemplateSection($customerId)
|
||||
: $this->ensureContentSection($customerId, $defaults['name'], $defaults['slug'], false);
|
||||
if ($defaults['is_template']) {
|
||||
$section = $this->ensureEmailtemplateSection($customerId);
|
||||
} else {
|
||||
$section = $this->fetchContentSectionBySlug($customerId, $defaults['slug']);
|
||||
}
|
||||
if (!$section) {
|
||||
$this->respond([
|
||||
'ok' => true,
|
||||
'kind' => 'content',
|
||||
'items' => [],
|
||||
'data' => [],
|
||||
'count' => 0,
|
||||
'offset' => 0,
|
||||
'limit' => 0,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
$this->handleContentList($section);
|
||||
}
|
||||
|
||||
@@ -1105,9 +1119,12 @@ class ApiKernel
|
||||
$auth = $this->requireAuth();
|
||||
$customerId = (int)($auth['customer_id'] ?? 0);
|
||||
$defaults = $this->resolveLegacySectionDefaults($kind);
|
||||
$section = $defaults['is_template']
|
||||
? $this->ensureEmailtemplateSection($customerId)
|
||||
: $this->ensureContentSection($customerId, $defaults['name'], $defaults['slug'], false);
|
||||
if ($defaults['is_template']) {
|
||||
$section = $this->ensureEmailtemplateSection($customerId);
|
||||
} else {
|
||||
$section = $this->fetchContentSectionBySlug($customerId, $defaults['slug']);
|
||||
}
|
||||
if (!$section) $this->fail('section not configured', ['kind' => $kind], 404);
|
||||
$this->handleContentGet($section);
|
||||
}
|
||||
|
||||
@@ -1116,9 +1133,12 @@ class ApiKernel
|
||||
$auth = $this->requireAuth();
|
||||
$customerId = (int)($auth['customer_id'] ?? 0);
|
||||
$defaults = $this->resolveLegacySectionDefaults($kind);
|
||||
$section = $defaults['is_template']
|
||||
? $this->ensureEmailtemplateSection($customerId)
|
||||
: $this->ensureContentSection($customerId, $defaults['name'], $defaults['slug'], false);
|
||||
if ($defaults['is_template']) {
|
||||
$section = $this->ensureEmailtemplateSection($customerId);
|
||||
} else {
|
||||
$section = $this->fetchContentSectionBySlug($customerId, $defaults['slug']);
|
||||
}
|
||||
if (!$section) $this->fail('section not configured', ['kind' => $kind], 404);
|
||||
$this->handleContentCreate($section);
|
||||
}
|
||||
|
||||
@@ -1127,9 +1147,12 @@ class ApiKernel
|
||||
$auth = $this->requireAuth();
|
||||
$customerId = (int)($auth['customer_id'] ?? 0);
|
||||
$defaults = $this->resolveLegacySectionDefaults($kind);
|
||||
$section = $defaults['is_template']
|
||||
? $this->ensureEmailtemplateSection($customerId)
|
||||
: $this->ensureContentSection($customerId, $defaults['name'], $defaults['slug'], false);
|
||||
if ($defaults['is_template']) {
|
||||
$section = $this->ensureEmailtemplateSection($customerId);
|
||||
} else {
|
||||
$section = $this->fetchContentSectionBySlug($customerId, $defaults['slug']);
|
||||
}
|
||||
if (!$section) $this->fail('section not configured', ['kind' => $kind], 404);
|
||||
$this->handleContentUpdate($section);
|
||||
}
|
||||
|
||||
@@ -1138,9 +1161,12 @@ class ApiKernel
|
||||
$auth = $this->requireAuth();
|
||||
$customerId = (int)($auth['customer_id'] ?? 0);
|
||||
$defaults = $this->resolveLegacySectionDefaults($kind);
|
||||
$section = $defaults['is_template']
|
||||
? $this->ensureEmailtemplateSection($customerId)
|
||||
: $this->ensureContentSection($customerId, $defaults['name'], $defaults['slug'], false);
|
||||
if ($defaults['is_template']) {
|
||||
$section = $this->ensureEmailtemplateSection($customerId);
|
||||
} else {
|
||||
$section = $this->fetchContentSectionBySlug($customerId, $defaults['slug']);
|
||||
}
|
||||
if (!$section) $this->fail('section not configured', ['kind' => $kind], 404);
|
||||
$this->handleContentDelete($section);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user