From d368af9de44b83102b339ac0155705a4889a1d8d Mon Sep 17 00:00:00 2001 From: Stefan Pfahler Date: Sat, 31 Dec 2022 12:28:37 +0100 Subject: [PATCH] doc: updated openapi documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Wörndle Signed-off-by: Stefan Pfahler --- .../Controllers/ResourcesController.cs | 33 +++++++++++-------- .../lib/api/ResourceService.ts | 1 - 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/deskstar-backend/Deskstar/Controllers/ResourcesController.cs b/src/deskstar-backend/Deskstar/Controllers/ResourcesController.cs index 32cf31c9..7a8bfd63 100644 --- a/src/deskstar-backend/Deskstar/Controllers/ResourcesController.cs +++ b/src/deskstar-backend/Deskstar/Controllers/ResourcesController.cs @@ -37,6 +37,7 @@ public ResourcesController(ILogger logger, IResourceUsecase /// /// /// Returns the buildings list + /// Bad Request /// Internal Server Error [HttpGet("buildings")] [Authorize] @@ -67,7 +68,7 @@ public IActionResult GetAllBuildings() /// POST /resources/buildings with JWT-Admin Token /// /// - /// Ok + /// CreateBuildingResponseObject /// Bad Request /// Not Found /// Internal Server Error @@ -114,8 +115,8 @@ public IActionResult CreateBuilding(CreateBuildingDto buildingDto) /// DELETE /resources/buildings/3de7afbf-0289-4ba6-bada-a34353c5548a with JWT-Admin Token /// /// - /// - /// Internal Server Error + /// Bad Request + /// Not Implemented [HttpDelete("buildings/{buildingId}")] [Authorize(Policy = "Admin")] [ProducesResponseType(StatusCodes.Status205ResetContent)] @@ -137,6 +138,7 @@ public IActionResult DeleteBuilding(string buildingId) /// /// /// Returns the floor list + /// Bad Request /// Internal Server Error [HttpGet("buildings/{buildingId}/floors")] [Authorize] @@ -166,7 +168,7 @@ public IActionResult GetFloorsByBuildingId(string buildingId) /// POST /resources/floors with JWT-Admin Token /// /// - /// Ok + /// CreateFloorResponseObject /// Bad Request /// Not Found /// Internal Server Error @@ -212,8 +214,8 @@ public IActionResult CreateFloor(CreateFloorDto floorDto) /// DELETE /resources/floors/3de7afbf-0289-4ba6-bada-a34353c5548a with JWT-Admin Token /// /// - /// - /// Internal Server Error + /// Bad Request + /// Not Impelemented [HttpDelete("floors/{floorId}")] [Authorize(Policy = "Admin")] [ProducesResponseType(StatusCodes.Status205ResetContent)] @@ -234,6 +236,7 @@ public IActionResult DeleteFloor(string floorId) /// /// /// Returns the rooms list + /// Bad Request /// Internal Server Error [HttpGet("floors/{floorId}/rooms")] [Authorize] @@ -263,7 +266,7 @@ public IActionResult GetRoomsByFloorId(string floorId) /// POST /resources/rooms with JWT-Admin Token /// /// - /// Ok + /// CreateRoomResponseObject /// Bad Request /// Not Found /// Internal Server Error @@ -310,8 +313,8 @@ public IActionResult CreateRoom(CreateRoomDto roomDto) /// DELETE /resources/rooms/3de7afbf-0289-4ba6-bada-a34353c5548a with JWT-Admin Token /// /// - /// - /// Internal Server Error + /// Bad Request + /// Not Implemented [HttpDelete("rooms/{roomId}")] [Authorize(Policy = "Admin")] [ProducesResponseType(StatusCodes.Status205ResetContent)] @@ -333,6 +336,7 @@ public IActionResult DeleteRoom(string roomId) /// /// /// Returns the desks list + /// Bad Request /// Internal Server Error [HttpGet("rooms/{roomId}/desks")] [Authorize] @@ -420,7 +424,7 @@ public IActionResult GetDeskDetailsByDeskId(string deskId, long start = 0, long /// POST /resources/desks with JWT-Admin Token /// /// - /// Ok + /// CreateDeskResponseObject /// Bad Request /// Not Found /// Internal Server Error @@ -468,8 +472,8 @@ public IActionResult CreateDesk(CreateDeskDto deskDto) /// DELETE /resources/desks/3de7afbf-0289-4ba6-bada-a34353c5548a with JWT-Admin Token /// /// - /// - /// Internal Server Error + /// Bad Request + /// Not Implemented [HttpDelete("desks/{deskId}")] [Authorize(Policy = "Admin")] [ProducesResponseType(StatusCodes.Status205ResetContent)] @@ -488,8 +492,8 @@ public IActionResult DeleteDesk(string deskId) /// POST /resources/desktypes with JWT-Admin Token /// /// - /// - /// + /// CreateDeskTypeResponseObject + /// Bad Request /// Internal Server Error [HttpPost("desktypes")] [Authorize(Policy = "Admin")] @@ -522,6 +526,7 @@ public IActionResult CreateDeskType(CreateDeskTypeDto deskTypeDto) /// /// /// List + /// Bad Request /// Internal Server Error [HttpGet("desktypes")] [Authorize(Policy = "Admin")] diff --git a/src/deskstar-frontend/lib/api/ResourceService.ts b/src/deskstar-frontend/lib/api/ResourceService.ts index 7aea3c40..810f9155 100644 --- a/src/deskstar-frontend/lib/api/ResourceService.ts +++ b/src/deskstar-frontend/lib/api/ResourceService.ts @@ -288,7 +288,6 @@ export async function createDeskType( } } - console.log("x"); return result; } type CreateDeskDto = {