Add project listing selector, confirmed revision and private 3MF renders
This commit is contained in:
@@ -36,6 +36,13 @@ class ProjectListingLinkController extends Controller
|
||||
return back()->withErrors(['listing_id' => $exception->getMessage()]);
|
||||
}
|
||||
|
||||
// Re-checked against a fresh (non-cached) fetch above, so this also catches
|
||||
// a listing that was active/draft when the dropdown was rendered but has
|
||||
// since gone inactive, expired or sold out.
|
||||
if (! in_array($listing['state'] ?? null, ['active', 'draft'], true)) {
|
||||
return back()->withErrors(['listing_id' => 'That listing is no longer Live or Draft and cannot be linked.']);
|
||||
}
|
||||
|
||||
try {
|
||||
$link = DB::transaction(function () use ($request, $project, $connection, $data, $listing, $variationKey): ProjectListingLink {
|
||||
$locked = Project::query()->whereKey($project->id)->lockForUpdate()->firstOrFail();
|
||||
|
||||
Reference in New Issue
Block a user