fix(Core): fix bug is lock

This commit is contained in:
2026-05-17 00:00:13 +03:30
parent 2796ce7de7
commit c3d798689c
8 changed files with 52 additions and 30 deletions

View File

@@ -83,13 +83,14 @@ class FolderController extends Controller
} else {
$shortText = $text;
}
$isLocked = !auth()->user()->isSubscriber() && (bool) $art->law?->is_locked;
return [
'id' => $art->id,
'title' => $art->title,
'text' => $shortText,
'text' => $isLocked ? null : $shortText,
'number' => $art->number,
'is_locked' => auth()->user()->isSubscriber() !== false ? false : Law::where('is_locked', $art->law->id)->first()?->is_locked,
'is_locked' => $isLocked,
'chapter' => $art->chapter != null ? [
'id' => $art->chapter->id,
'title' => $art->chapter->title,