mirror of
https://github.com/QuotifyTeam/QuotifyBE.git
synced 2025-12-16 19:20:06 +01:00
fix: fixes to addQuote (don't require categories nor imageUrl)
also sends back role upon login
This commit is contained in:
@@ -141,13 +141,13 @@ public class QuotesController : ControllerBase
|
||||
Author = request.Author,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
LastUpdatedAt = DateTime.UtcNow,
|
||||
ImageId = image?.Id ?? 0,
|
||||
ImageId = image?.Id ?? null,
|
||||
UserId = userId,
|
||||
QuoteCategories = new List<QuoteCategory>()
|
||||
};
|
||||
|
||||
// Attach categories
|
||||
foreach (var categoryId in request.CategoryIds)
|
||||
foreach (var categoryId in request.CategoryIds ?? [])
|
||||
{
|
||||
var categoryExists = await _db.Categories.AnyAsync(c => c.Id == categoryId);
|
||||
if (!categoryExists)
|
||||
|
||||
Reference in New Issue
Block a user