コード例 #1
0
        public ActionResult <HabitResponse> UpdateHabit(Guid userID, Guid id, [FromBody] RequestData data)
        {
            var result = Habit.UpdateHabit(id, data, userID);;

            if (result == null)
            {
                return(NotFound("User not found"));
            }

            return(result);
        }
コード例 #2
0
        public static Habit Update(Guid habitID, Guid userID, String habit_name, String[] days)
        {
            IGainer logGainer = new LogSuccess();

            if (!checkDays(days))
            {
                return(null);
            }

            Habit h = Habit.UpdateHabit(habitID, userID, habit_name, logGainer);

            h.UpdateDayOff(days);
            return(h);
        }