public async Task UpdatePlanIsSharedStatus(string planId, bool isShared) { var plan = await dbPersonalizedPlan.GetPersonalizedPlanAsync(Guid.Parse(planId)); if (plan != null && plan.PersonalizedPlanId != Guid.Empty) { plan.IsShared = isShared; await dbService.UpdateItemAsync(planId, plan, dbSettings.ActionPlansCollectionId); } }
public async Task <IActionResult> GetPersonalizedPlanAsync([FromQuery] Guid personalizedPlanId) { var personalizedPlan = await personalizedPlanBusinessLogic.GetPersonalizedPlanAsync(personalizedPlanId); if (personalizedPlan.PersonalizedPlanId == default(Guid)) { return(StatusCode(StatusCodes.Status404NotFound, $"Could not find a plan with this Id {personalizedPlanId}")); } if (personalizedPlan == null) { return(StatusCode(StatusCodes.Status500InternalServerError)); } return(Ok(personalizedPlan)); }