Rewrite handlers
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using DispatchR.Abstractions.Send;
|
||||
using Musify.Application.Contracts.Application;
|
||||
using Musify.Application.PlayLists.Responses;
|
||||
using Musify.Domain.Entities;
|
||||
|
||||
namespace Musify.Application.PlayLists.Commands
|
||||
{
|
||||
@@ -10,5 +11,21 @@ namespace Musify.Application.PlayLists.Commands
|
||||
string Name,
|
||||
string Description,
|
||||
IFileData? Picture)
|
||||
: IRequest<CreatePlayListCommand, Task<Result<PlayListResponse>> >;
|
||||
: IRequest<CreatePlayListCommand, Task<Result<PlayListResponse>> >
|
||||
{
|
||||
public static PlayList ToEntity(CreatePlayListCommand command, string originalKey, string smallKey, string mediumKey, string largeKey)
|
||||
{
|
||||
return new PlayList
|
||||
{
|
||||
UserId = command.UserId,
|
||||
Name = command.Name,
|
||||
NormalizedName = command.Name.Trim().ToUpperInvariant(),
|
||||
Description = command.Description,
|
||||
OriginalPictureName = originalKey,
|
||||
SmallPictureName = smallKey,
|
||||
MediumPictureName = mediumKey,
|
||||
LargePictureName = largeKey,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user