Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

fix: Delete response #29

Merged
merged 3 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions WAW.API/Auth/Controllers/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ [FromBody] UserRequest resource
}

[HttpDelete("{id:int}")]
[ProducesResponseType(typeof(UserResource), 200)]
[ProducesResponseType(typeof(NoContentResult), 204)]
[ProducesResponseType(typeof(List<string>), 400)]
[ProducesResponseType(500)]
[SwaggerResponse(200, "The user was deleted successfully", typeof(UserResource))]
[SwaggerResponse(204, "The user was deleted successfully", typeof(NoContentResult))]
[SwaggerResponse(400, "The selected user to delete does not exist")]
public async Task<IActionResult> DeleteAsync(
[FromRoute] [SwaggerParameter("User identifier", Required = true)] int id
) {
var result = await service.Delete(id);
return result.ToResponse<UserResource>(this, mapper);
await service.Delete(id);
return NoContent();
}
}
8 changes: 4 additions & 4 deletions WAW.API/Chat/Controllers/ChatRoomController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ ChatRoomRequest request
}

[HttpDelete("{id:long}")]
[ProducesResponseType(typeof(ChatRoomResource), 200)]
[ProducesResponseType(typeof(NoContentResult), 204)]
[ProducesResponseType(typeof(List<string>), 400)]
[ProducesResponseType(500)]
[SwaggerResponse(200, "The chat room was deleted successfully", typeof(ChatRoomResource))]
[SwaggerResponse(204, "The chat room was deleted successfully", typeof(NoContentResult))]
[SwaggerResponse(400, "The selected chat room to delete does not exist")]
public async Task<IActionResult> DeleteAsync(
[FromRoute] [SwaggerParameter("ChatRoom identifier", Required = true)] long id
) {
var result = await chatService.Delete(id);
return result.ToResponse<ChatRoomResource>(this, mapper);
await chatService.Delete(id);
return NoContent();
}
}
8 changes: 4 additions & 4 deletions WAW.API/Chat/Controllers/MessageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ [FromBody] [SwaggerRequestBody("The message object about to create", Required =
}

[HttpDelete("{id:long}")]
[ProducesResponseType(typeof(MessageResource), 200)]
[ProducesResponseType(typeof(NoContentResult), 204)]
[ProducesResponseType(typeof(List<string>), 400)]
[ProducesResponseType(500)]
[SwaggerResponse(200, "The message was deleted successfully", typeof(MessageResource))]
[SwaggerResponse(204, "The message was deleted successfully", typeof(NoContentResult))]
[SwaggerResponse(400, "The selected message to delete does not exist")]
public async Task<IActionResult> DeleteAsync(
[FromRoute] [SwaggerParameter("Message identifier", Required = true)] long id
) {
var result = await service.Delete(id);
return result.ToResponse<MessageResponse>(this, mapper);
await service.Delete(id);
return NoContent();
}
}
8 changes: 4 additions & 4 deletions WAW.API/Employers/Controllers/CompaniesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ CompanyRequest companyRequest
}

[HttpDelete("{id:int}")]
[ProducesResponseType(typeof(CompanyResource), 200)]
[ProducesResponseType(typeof(NoContentResult), 204)]
[ProducesResponseType(typeof(List<string>), 400)]
[ProducesResponseType(500)]
[SwaggerResponse(200, "The company was deleted successfully", typeof(CompanyResource))]
[SwaggerResponse(204, "The company was deleted successfully", typeof(NoContentResult))]
[SwaggerResponse(400, "The selected company to delete does not exist")]
public async Task<IActionResult> DeleteAsync(
[FromRoute] [SwaggerParameter("Company identifier", Required = true)] int id
) {
var result = await service.Delete(id);
return result.ToResponse<CompanyResource>(this, mapper);
await service.Delete(id);
return NoContent();
}
}
8 changes: 4 additions & 4 deletions WAW.API/Job/Controllers/OffersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ [FromBody] OfferRequest resource
}

[HttpDelete("{id:int}")]
[ProducesResponseType(typeof(OfferResource), 200)]
[ProducesResponseType(typeof(NoContentResult), 204)]
[ProducesResponseType(typeof(List<string>), 400)]
[ProducesResponseType(500)]
[SwaggerResponse(200, "The job offer was deleted successfully", typeof(OfferResource))]
[SwaggerResponse(204, "The job offer was deleted successfully", typeof(NoContentResult))]
[SwaggerResponse(400, "The selected job offer to delete does not exist")]
public async Task<IActionResult> DeleteAsync(
[FromRoute] [SwaggerParameter("Job offer identifier", Required = true)] int id
) {
var result = await service.Delete(id);
return result.ToResponse<OfferResource>(this, mapper);
await service.Delete(id);
return NoContent();
}
}