PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / trunk
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration vtrunk
2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 1.45 All 41 releases
← All changes | app/Http/Controllers/NotificationController.php +5 -10 1.95trunk View file →
@@ -52,22 +52,17 @@
52 52 return $this->sendError($e->getMessage(), 400);
53 53 }
54 54 }
55 55
56 + /**
57 + * Return the current user's board notification settings with safe defaults.
58 + */
56 59 public function getBoardNotificationSettings($board_id)
57 60 {
58 61 $board_id = absint($board_id);
59 62 try {
60 63 $userId = get_current_user_id();
61 - $currentSettings = [];
62 - $boardSettings = $this->notificationService->getBoardNotificationSettingsOfUser($board_id, $userId);
63 - if ($boardSettings && $boardSettings->preferences) {
64 - $unserializedData = maybe_unserialize($boardSettings->preferences);
65 - // Validate unserialized data is an array
66 - if (is_array($unserializedData)) {
67 - $currentSettings = $unserializedData;
68 - }
69 - }
64 + $currentSettings = $this->notificationService->getBoardNotificationSettingsWithDefaults($board_id, $userId);
70 65
71 66 return $this->sendSuccess([
72 67 'currentSettings' => $currentSettings,
73 68 ], 200);
@@ -119,5 +114,5 @@
119 114 } catch (\Exception $e) {
120 115 return $this->sendError($e->getMessage(), 400);
121 116 }
122 117 }
123 -}
118 +}