feat: return creation/update time

This commit is contained in:
2025-07-28 14:09:51 +02:00
parent 98dc591dce
commit 8a8aac77da
4 changed files with 43 additions and 5 deletions

View File

@@ -94,7 +94,7 @@ public class CategoryController : ControllerBase
[HttpGet]
[EnableCors]
[ProducesResponseType(typeof(List<CategoryShortDTO>), 200)]
public async Task<IActionResult> GetQuotePage()
public async Task<IActionResult> GetEveryCategory()
{
// The following seems to be a bad idea, so I leave it as is. ~eee4
//

View File

@@ -46,7 +46,7 @@ public class QuotesController : ControllerBase
/// <response code="404">Returned when requested page is invalid (page_no &lt;= 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