Example #1
0
        public async Task <booleanJson> UpdateRecipe(int id, [FromBody] Recipe recipe)
        {
            booleanJson isUpdated = new booleanJson();

            isUpdated.flag = await _recipesService.EditRecipe(id, recipe);

            return(isUpdated);
        }
Example #2
0
        public async Task <booleanJson> DeleteRecipe(int id)
        {
            booleanJson isDeleted = new booleanJson();

            isDeleted.flag = await _recipesService.DeleteRecipe(id);

            return(isDeleted);
        }
Example #3
0
        public async Task <booleanJson> SaveRecipe([FromBody] SaveUserRecipe saveUserRecipe)
        {
            booleanJson isSaved = new booleanJson();

            isSaved.flag = await _usersService.SaveRecipe(saveUserRecipe);

            return(isSaved);
        }
Example #4
0
        //[Route("post")]
        public async Task <ActionResult <booleanJson> > JoinGroup([FromBody] UsersGroup ug)
        {
            bool joined = await _usersService.JoinGroup(ug);

            booleanJson boolJ = new booleanJson {
                flag = joined
            };

            return(boolJ);
        }
Example #5
0
        public async Task <booleanJson> UpdateRecipe(int id, [FromBody] RecipePlusTags recipePlusTags)
        {
            Recipe recipe = recipePlusTags.recipe;
            string tags   = recipePlusTags.tags;

            List <RecipeTag> recipeTags = JsonConvert.DeserializeObject <List <RecipeTag> >(tags);

            recipe.RecipeTags = recipeTags;

            booleanJson isUpdated = new booleanJson();

            isUpdated.flag = await _recipesService.EditRecipe(id, recipe);

            return(isUpdated);
        }