mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Started the page attributes interface
This commit is contained in:
@ -38,18 +38,15 @@ class AttributeController extends Controller
|
||||
*/
|
||||
public function updateForEntity($entityType, $entityId, Request $request)
|
||||
{
|
||||
|
||||
$this->validate($request, [
|
||||
'attributes.*.name' => 'required|min:3|max:250',
|
||||
'attributes.*.value' => 'max:250'
|
||||
]);
|
||||
|
||||
$entity = $this->attributeRepo->getEntity($entityType, $entityId, 'update');
|
||||
if ($entity === null) return $this->jsonError("Entity not found", 404);
|
||||
|
||||
$inputAttributes = $request->input('attributes');
|
||||
$attributes = $this->attributeRepo->saveAttributesToEntity($entity, $inputAttributes);
|
||||
return response()->json($attributes);
|
||||
return response()->json([
|
||||
'attributes' => $attributes,
|
||||
'message' => 'Attributes successfully updated'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -72,7 +72,7 @@ class PageController extends Controller
|
||||
$this->checkOwnablePermission('page-create', $book);
|
||||
$this->setPageTitle('Edit Page Draft');
|
||||
|
||||
return view('pages/create', ['draft' => $draft, 'book' => $book]);
|
||||
return view('pages/edit', ['page' => $draft, 'book' => $book, 'isDraft' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user