feat: provide user data on login, minor fix to seeding, logical fixes

This commit is contained in:
2025-07-16 16:51:54 +02:00
parent 4b7b731679
commit 09bc6637a8
9 changed files with 88 additions and 33 deletions

View File

@@ -8,7 +8,7 @@ namespace QuotifyBE.Mapping;
public static class QuoteMapping
{
public static QuoteShortDTO ToQuoteShortDTO(this Quote quote, ApplicationDbContext db)
public static QuoteShortDTO ToQuoteShortDTO(this Quote quote)
{
List<string> categoryNames = [];

29
Mapping/UserMapping.cs Normal file
View File

@@ -0,0 +1,29 @@
using QuotifyBE.DTOs;
using QuotifyBE.Entities;
namespace QuotifyBE.Mapping;
public static class UserMapping
{
public static SuccessfulLoginDTO ToSuccessfulLoginDTO(this User user, string token)
{
return new SuccessfulLoginDTO
{
Status = "ok",
Token = token,
User = user.ToUserInfoDTO()
};
}
public static UserInfoDTO ToUserInfoDTO(this User user)
{
return new UserInfoDTO
{
Id = user.Id,
Name = user.Name,
Email = user.Email
};
}
}