Esempio n. 1
0
        protected virtual IActionResult SetGoal(SetGoalRequest setGoalRequest)
        {
            if (setGoalRequest == null)
            {
                return(BadRequest());
            }

            try
            {
                AccountServices.CreateGoal(GetUser(), setGoalRequest.GoalOptionId, setGoalRequest.Timeframe, setGoalRequest.Risk,
                                           setGoalRequest.TargetAmount, setGoalRequest.StartingAmount, setGoalRequest.MonthlyContribution);
            }
            catch (ArgumentException ex)
            {
                return(BadRequest(new { error = ex.Message }));
            }
            return(Ok());
        }