mobile app api
This commit is contained in:
@@ -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()));
|
||||
Reference in New Issue
Block a user