mobile app api

This commit is contained in:
2026-07-27 21:04:07 +03:00
parent 9241e177ac
commit 6913024596
54 changed files with 5156 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
require __DIR__ . '/_bootstrap.php';
/**
* @OA\Get(
* path="/shares-incoming.php",
* tags={"Sharing"},
* summary="Incoming invitations (shared with me)",
* security={{"bearerAuth":{}}},
* @OA\Response(response=200, description="OK", @OA\JsonContent(
* @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/Share"))
* )),
* @OA\Response(response=401, ref="#/components/responses/Unauthorized")
* )
*/
require_method('GET');
$user = require_auth($pdo);
$stmt = $pdo->prepare(
'SELECT hs.*, sr.role_name, sr.description AS role_description, sr.permissions AS role_permissions
FROM home_sharing hs
LEFT JOIN sharing_roles sr ON sr.idrole = hs.role_id
WHERE hs.idshareduser = ? OR hs.shared_email = ?
ORDER BY hs.idsharing DESC'
);
$stmt->execute([$user['id'], $user['email']]);
json_data(array_map('present_share', $stmt->fetchAll()));