()
| 80 | } |
| 81 | |
| 82 | [HttpGet("/api/_apps")] |
| 83 | public async Task<IActionResult> ListApps() |
| 84 | { |
| 85 | var user = this.GetCurrentUserIdentity(); |
| 86 | |
| 87 | var apps = await _db.Connection.QueryAsync<Application>( |
| 88 | @"SELECT a.id, a.name, a.icon_path, a.app_key, |
| 89 | a.owner_id = @userId AS has_ownership, a.has_events, |
| 90 | u.lock_reason |
| 91 | FROM apps a |
| 92 | LEFT JOIN app_shares s |
| 93 | ON s.app_id = a.id |
| 94 | INNER JOIN users u |
| 95 | ON u.id = a.owner_id |
| 96 | WHERE (a.owner_id = @userId OR s.email = @userEmail) |
| 97 | AND a.deleted_at IS NULL |
| 98 | GROUP BY a.id, a.name, a.icon_path, a.app_key, u.lock_reason |
| 99 | ORDER by a.name", new { userId = user.Id, userEmail = user.Email }); |
| 100 | |
| 101 | return Ok(apps); |
| 102 | } |
| 103 | |
| 104 | [HttpPost("/api/_apps")] |
| 105 | public async Task<IActionResult> Create([FromBody] CreateAppRequestBody body) |
nothing calls this directly
no test coverage detected