verison
This commit is contained in:
@@ -857,6 +857,16 @@ class ApiKernel
|
||||
foreach ($data as $k => $v) $stmt->bindValue(":$k", $v);
|
||||
$stmt->execute();
|
||||
$newId = (int)$this->pdo->lastInsertId();
|
||||
try {
|
||||
$stmt = $this->pdo->prepare("SELECT * FROM `$itemsTable` WHERE `id` = :id AND `customer_id` = :cid LIMIT 1");
|
||||
$stmt->execute([':id' => $newId, ':cid' => $customerId]);
|
||||
$row = $stmt->fetch();
|
||||
if ($row) {
|
||||
$this->createContentVersion($row, $itemCols, $customerId, (int)$section['id']);
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// ignore versioning failures on create
|
||||
}
|
||||
$this->respond(['ok' => true, 'kind' => 'content', 'id' => $newId, 'item' => ['id' => $newId, 'name' => $name]]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user