public async Task <IActionResult> UpdatePageAsync(Guid userId, Guid pageId, [FromBody] GeneralWebPageUpdateRequest updateRequest, CancellationToken cancellationToken) { if (updateRequest.Blocks != null) { foreach (var block in updateRequest.Blocks) { if (block.Item.ContentType == "textBlock" && block.Content.ContainsKey("blocks")) { block.Content.Remove("blocks"); } } } var pageGuid = await _contentService.UpdatePageAsync(userId, pageId, updateRequest, cancellationToken); return(new JsonResult(pageGuid)); }
/// <inheritdoc /> public async Task <ApiResponse <string> > UpdatePageAsync(Guid userId, Guid contentId, GeneralWebPageUpdateRequest updateRequest, CancellationToken cancellationToken) { if (Guid.Empty == userId) { throw new ArgumentOutOfRangeException(nameof(userId)); } if (Guid.Empty == contentId) { throw new ArgumentOutOfRangeException(nameof(contentId)); } return(await _contentCommand.UpdatePageAsync(contentId, updateRequest, cancellationToken)); }
/// <inheritdoc /> public Task <ApiResponse <string> > UpdatePageAsync(Guid contentId, GeneralWebPageUpdateRequest pageModel, CancellationToken cancellationToken) { return(_contentApiClientProvider.SendRequestAsync <ApiResponse <string> >(HttpMethod.Put, $"api/page/{contentId}", JsonContent.Create(pageModel))); }