From b7e39b59fd0fc7b5610ebff29035bf622079e0d8 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Wed, 5 Oct 2022 20:45:21 +0800 Subject: refactor: Change file structure --- .../src/Endpoints/V1/ApiTokens/GetTokensRoute.cs | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 server/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs (limited to 'server/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs') diff --git a/server/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs b/server/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs deleted file mode 100644 index 59fd077..0000000 --- a/server/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace IOL.GreatOffice.Api.Endpoints.V1.ApiTokens; - -public class GetTokensRoute : RouteBaseSync.WithoutRequest.WithResult>> -{ - private readonly AppDbContext _context; - - public GetTokensRoute(AppDbContext context) { - _context = context; - } - - /// - /// Get all tokens, both active and inactive. - /// - /// A list of tokens - [ApiVersion(ApiSpecV1.VERSION_STRING)] - [HttpGet("~/v{version:apiVersion}/api-tokens")] - [ProducesResponseType(200, Type = typeof(List))] - [ProducesResponseType(204)] - public override ActionResult> Handle() { - return Ok(_context.AccessTokens.Where(c => c.User.Id == LoggedInUser.Id).Select(c => c.AsDto)); - } -} -- cgit v1.3