[HttpDelete("{id}")] // vercnum em FAQ-i id-n u jnjum public async Task <string> DeleteFAQ(int id) { bool done = await FAQActions.DeleteFAQ(id, done : false); if (!done) { return("not exists"); } else { return("deleted"); } }
[HttpGet("{p}")] // api/Faqs/"search", public async Task <ActionResult <Page <FAQ> > > GetFAQsSearch(int p) //string search) { if (p <= 0) { return(BadRequest()); } var ToReturn = await FAQActions.GetFAQsSearch(p); if (p > ToReturn.PageCount) { return(BadRequest()); } return(ToReturn); }
public async Task <ActionResult <List <Group> > > PutFAQ(int id, FAQ fAQ) // { if (fAQ.Answer == null || fAQ.Question == null || fAQ.GroupId <= 0 || id <= 0) { return(BadRequest()); } bool done = await FAQActions.PutFAQ(id, fAQ); if (!done) { return(BadRequest()); } else { return(AG.Groups); } }
public async Task <ActionResult <List <Group> > > PostFAQ(FAQ faq) { if (faq.Answer == null || faq.Question == null || faq.GroupId <= 0) { return(BadRequest()); } bool done = await FAQActions.PostFAQ(faq, done : false); if (!done) { return(BadRequest()); } else { return(AG.Groups); } }