Öffne Katalog, Bibliothek und Testkauf für den MVP.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
463851d402
commit
fd6860efda
51 files changed
+2331
-31
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Domain\Catalog;
|
||||
|
||||
use App\Jobs\StoreContentFile;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -29,10 +30,10 @@ public function publishElementVersion(
|
||||
}
|
||||
|
||||
$number = ((int) $element->versions()->max('number')) + 1;
|
||||
|
||||
return $element->versions()->create([
|
||||
$incoming = $metadata['incoming'] ?? null;
|
||||
$version = $element->versions()->create([
|
||||
'number' => $number,
|
||||
'status' => ContentVersionStatus::Bereit,
|
||||
'status' => is_string($incoming) && $incoming !== '' ? ContentVersionStatus::Entwurf : ContentVersionStatus::Bereit,
|
||||
'content_hash' => hash('sha256', json_encode([
|
||||
'body' => $body,
|
||||
'metadata' => $metadata,
|
||||
@@ -41,6 +42,13 @@ public function publishElementVersion(
|
||||
'metadata' => $metadata === [] ? null : $metadata,
|
||||
'change_note' => $changeNote,
|
||||
]);
|
||||
|
||||
if (is_string($incoming) && $incoming !== '') {
|
||||
StoreContentFile::dispatch($version->id, $incoming);
|
||||
$version->refresh();
|
||||
}
|
||||
|
||||
return $version;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user