mirror of
https://github.com/QuotifyTeam/QuotifyBE.git
synced 2025-12-16 19:00:07 +01:00
feat: provide user data on login, minor fix to seeding, logical fixes
This commit is contained in:
@@ -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
29
Mapping/UserMapping.cs
Normal 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
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user