Esempio n. 1
0
        public async Task <IActionResult> SearchKeyword(SearchRequestModel model)
        {
            try
            {
                if (model.Keyword != null)
                {
                    var userId = TokenUserId();
                    List <DisplayResponceModel> data = await note.SearchKeyword(model.Keyword, userId);

                    if (data.Count != 0)
                    {
                        return(Ok(new { success = true, Meassage = "Search Keyword SucessessFully", data }));
                    }
                    else
                    {
                        return(BadRequest(new { success = false, Meassage = "Search Keyword unsuceessful" }));
                    }
                }
                else
                {
                    return(BadRequest(new { success = false, Meassage = "Invalid Input!" }));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(new { success = false, Meassage = e.Message }));
            }
        }