17 lines
681 B
PHP
17 lines
681 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
require_once __DIR__ . '/common.php';
|
|
|
|
/**
|
|
* Berührungs-Ping der App: meldet, dass die Person die App gerade benutzt. Dadurch geht sie nach längerer Inaktivität nicht
|
|
* auf "Offline" und kommt aus dem automatischen Offline zurück (siehe includes/staff_activity.php).
|
|
* POST {} -> {ok: true, status: "available"|...}
|
|
*/
|
|
api_require_method('POST');
|
|
$staff = api_require_staff();
|
|
$pdo = get_db();
|
|
staff_touch_activity($pdo, (int) $staff['id']);
|
|
$s = $pdo->prepare('SELECT status FROM staff_availability WHERE staff_id = ?');
|
|
$s->execute([(int) $staff['id']]);
|
|
api_json(['ok' => true, 'status' => (string) ($s->fetchColumn() ?: 'offline')]);
|