public async Task <IActionResult> ReorderProducts(string id, [FromBody] ReorderModel data) { if (string.IsNullOrWhiteSpace(id) || data.IdList.Count < 1) { return(BadRequest()); } return(await this.Execute(true, false, async() => { await this.categories.ReorderProducts(id, data.IdList); return this.Ok(); })); }
public async Task <ActionResult> ReorderAsync(string repositoryAlias, [FromBody] ReorderModel reorder) { try { var response = await _apiHandlerResolver.GetApiHandler(repositoryAlias).ReorderAsync(new ApiRequestModel { Body = await ReadBodyAsStringAsync() }); return(response.ToContentResult()); } catch { } return(BadRequest()); }
public async Task <IActionResult> ReorderTreeAsync([FromBody] ReorderModel model) { try { if (!(ModelState.IsValid && await model.IsValidReorderAsync(this.goalsService))) { return(BadRequest(model)); } var movedGoal = await this.goalsService.ReorderTreeAsync( model.GoalId, model.TargetParentId); return(Ok(movedGoal)); } catch (Exception ex) { return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> Reorder([FromBody] ReorderModel data) { var e = ""; System.Console.WriteLine(e); if (data == null) { return(BadRequest(ModelConstants.InvalidCategoryPlace)); } if (data.IdList.Count < 1) { return(BadRequest(ModelConstants.InvalidCategoryPlace)); } return(await this.Execute(true, false, async() => { await this.categories.Reorder(data.IdList); return this.Ok(); })); }
public ApiResult Reorder([FromBody] ReorderModel model) { _logger.LogDebug($"publish model={Newtonsoft.Json.JsonConvert.SerializeObject(model)}, userId={_userId}"); _siteMapModifyService.ReorderSiteMapItems(_siteId, _userId, model.ItemId, model.RelatedItemId, model.IsInsertBefore, _step); return(ApiResult.Success()); }