load with public flag

This commit is contained in:
john 2025-05-18 13:40:05 +02:00
parent e3c95eb109
commit 322dd01ee0
14 changed files with 73 additions and 38 deletions

View file

@ -2,7 +2,7 @@ using Femto.Common.Domain;
namespace Femto.Modules.Blog.Application.Commands.CreatePost;
public record CreatePostCommand(Guid AuthorId, string Content, IEnumerable<CreatePostMedia> Media)
public record CreatePostCommand(Guid AuthorId, string Content, IEnumerable<CreatePostMedia> Media, bool? IsPublic)
: ICommand<Guid>;
public record CreatePostMedia(Guid MediaId, Uri Url, string? Type, int Order, int? Width, int? Height);

View file

@ -22,6 +22,8 @@ internal class CreatePostCommandHandler(BlogContext context)
))
.ToList()
);
post.IsPublic = request.IsPublic is true;
await context.AddAsync(post, cancellationToken);