public async Task <ContentItem> CreateContent(ContentCreationRequest creationRequest) { var command = new CreateContentCommand(creationRequest); var itemReference = await _mediator.Send(command); return(await GetContentItem(itemReference, PublishingTarget.Preview)); }
public async Task <ActionResult <Response <ItemDto> > > Upload([FromForm] CreateContentCommand createContentCommand) { if (createContentCommand.File is null) { return(BadRequest(_configuration["Storage:Messages:EmptyFile"])); } return(Ok(await UploadBase(new List <CreateContentCommand> { createContentCommand }))); }
//[Authorize(Roles = "SuperAdmin,Writer")] public async Task <ActionResult <Response <int> > > Post(CreateContentCommand command) { return(Ok(await Mediator.Send(command))); }