diff options
Diffstat (limited to 'apps/user_status')
-rw-r--r-- | apps/user_status/appinfo/routes.php | 7 | ||||
-rw-r--r-- | apps/user_status/lib/Controller/HeartbeatController.php | 3 | ||||
-rw-r--r-- | apps/user_status/src/services/heartbeatService.js | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/apps/user_status/appinfo/routes.php b/apps/user_status/appinfo/routes.php index d360dc1ebd5..147d1927358 100644 --- a/apps/user_status/appinfo/routes.php +++ b/apps/user_status/appinfo/routes.php @@ -35,9 +35,8 @@ return [ ['name' => 'UserStatus#setCustomMessage', 'url' => '/api/v1/user_status/message/custom', 'verb' => 'PUT'], ['name' => 'UserStatus#clearMessage', 'url' => '/api/v1/user_status/message', 'verb' => 'DELETE'], // Routes for listing default routes - ['name' => 'PredefinedStatus#findAll', 'url' => '/api/v1/predefined_statuses/', 'verb' => 'GET'] - ], - 'routes' => [ - ['name' => 'Heartbeat#heartbeat', 'url' => '/heartbeat', 'verb' => 'PUT'], + ['name' => 'PredefinedStatus#findAll', 'url' => '/api/v1/predefined_statuses/', 'verb' => 'GET'], + // Route for doing heartbeats + ['name' => 'Heartbeat#heartbeat', 'url' => '/api/v1/heartbeat', 'verb' => 'PUT'], ], ]; diff --git a/apps/user_status/lib/Controller/HeartbeatController.php b/apps/user_status/lib/Controller/HeartbeatController.php index c11a63b4420..82978f0983a 100644 --- a/apps/user_status/lib/Controller/HeartbeatController.php +++ b/apps/user_status/lib/Controller/HeartbeatController.php @@ -31,6 +31,7 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; +use OCP\AppFramework\OCSController; use OCP\AppFramework\Utility\ITimeFactory; use OCP\EventDispatcher\IEventDispatcher; use OCP\IRequest; @@ -38,7 +39,7 @@ use OCP\IUserSession; use OCP\User\Events\UserLiveStatusEvent; use OCP\UserStatus\IUserStatus; -class HeartbeatController extends Controller { +class HeartbeatController extends OCSController { /** @var IEventDispatcher */ private $eventDispatcher; diff --git a/apps/user_status/src/services/heartbeatService.js b/apps/user_status/src/services/heartbeatService.js index 2065cb6836a..8c429c45049 100644 --- a/apps/user_status/src/services/heartbeatService.js +++ b/apps/user_status/src/services/heartbeatService.js @@ -21,7 +21,7 @@ */ import HttpClient from '@nextcloud/axios' -import { generateUrl } from '@nextcloud/router' +import { generateOcsUrl } from '@nextcloud/router' /** * Sends a heartbeat @@ -30,7 +30,7 @@ import { generateUrl } from '@nextcloud/router' * @return {Promise<void>} */ const sendHeartbeat = async (isAway) => { - const url = generateUrl('/apps/user_status/heartbeat') + const url = generateOcsUrl('apps/user_status/api/v1/heartbeat?format=json') const response = await HttpClient.put(url, { status: isAway ? 'away' : 'online', }) |