namespace BookStack\Activity\Controllers;
-use BookStack\Activity\Models\Watch;
use BookStack\Activity\Tools\UserEntityWatchOptions;
use BookStack\App\Model;
use BookStack\Entities\Models\Entity;
{
public function update(Request $request)
{
+ $this->checkPermission('receive-notifications');
+ $this->preventGuestAccess();
+
$requestData = $this->validate($request, [
'level' => ['required', 'string'],
]);
$watchable = $this->getValidatedModelFromRequest($request);
$watchOptions = new UserEntityWatchOptions(user(), $watchable);
- $watchOptions->updateWatchLevel($requestData['level']);
+ $watchOptions->updateLevelByName($requestData['level']);
$this->showSuccessNotification(trans('activities.watch_update_level_notification'));