mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Notifications: Linked watch functionality to UI
Got watch system working to an initial base state. Moved some existing logic where it makes sense.
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
namespace BookStack\Activity\Controllers;
|
||||
|
||||
use BookStack\Activity\Models\Watch;
|
||||
use BookStack\Activity\Tools\UserWatchOptions;
|
||||
use BookStack\App\Model;
|
||||
use BookStack\Entities\Models\Entity;
|
||||
use BookStack\Http\Controller;
|
||||
@ -19,13 +20,12 @@ class WatchController extends Controller
|
||||
]);
|
||||
|
||||
$watchable = $this->getValidatedModelFromRequest($request);
|
||||
$newLevel = Watch::optionNameToLevel($requestData['level']);
|
||||
$watchOptions = new UserWatchOptions(user());
|
||||
$watchOptions->updateEntityWatchLevel($watchable, $requestData['level']);
|
||||
|
||||
if ($newLevel < 0) {
|
||||
// TODO - Delete
|
||||
} else {
|
||||
// TODO - Upsert
|
||||
}
|
||||
$this->showSuccessNotification(trans('activities.watch_update_level_notification'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user