mirror of
https://github.com/QuotifyTeam/QuotifyBE.git
synced 2025-12-16 20:10:07 +01:00
feat: return creation/update time
This commit is contained in:
@@ -46,7 +46,7 @@ public class QuotesController : ControllerBase
|
||||
/// <response code="404">Returned when requested page is invalid (page_no <= 0)</response>
|
||||
[HttpGet("page/{page_no}")]
|
||||
[EnableCors]
|
||||
[ProducesResponseType(typeof(List<QuoteShortDTO>), 200)]
|
||||
[ProducesResponseType(typeof(List<QuoteCompleteDTO>), 200)]
|
||||
[ProducesResponseType(typeof(ErrorDTO), 404)]
|
||||
public async Task<IActionResult> GetQuotePage(int page_no = 1, string? sort = "desc", [FromQuery] string? category_id = null)
|
||||
{
|
||||
@@ -113,7 +113,7 @@ public class QuotesController : ControllerBase
|
||||
}
|
||||
|
||||
var result = pageQuotes
|
||||
.Select(q => q.ToQuoteShortDTO())
|
||||
.Select(q => q.ToQuoteCompleteDTO())
|
||||
.ToList();
|
||||
|
||||
return Ok(result);
|
||||
@@ -132,7 +132,7 @@ public class QuotesController : ControllerBase
|
||||
/// <response code="200">Returned on valid request</response>
|
||||
/// <response code="404">Returned when quote id is invalid or simply doesn't exist</response>
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(typeof(QuoteShortDTO), 200)]
|
||||
[ProducesResponseType(typeof(QuoteCompleteDTO), 200)]
|
||||
[ProducesResponseType(typeof(ErrorDTO), 404)]
|
||||
public async Task<IActionResult> GetQuoteById(int id)
|
||||
{
|
||||
@@ -147,7 +147,7 @@ public class QuotesController : ControllerBase
|
||||
if (quote == null)
|
||||
return NotFound(new { status = "error", error_msg = "Quote not found" });
|
||||
|
||||
return Ok(quote.ToQuoteShortDTO());
|
||||
return Ok(quote.ToQuoteCompleteDTO());
|
||||
}
|
||||
|
||||
// POST /api/v1/quotes/new
|
||||
|
||||
Reference in New Issue
Block a user