func deleteAI(c common.Context) { if c.Authenticated() { if ai := models.GetAIById(c, common.MustDecodeKey(c.Vars["ai_id"])); ai != nil && ai.Owner == c.User.Email { ai.Delete(c) } } }
func getAIErrors(c common.Context) { if c.Authenticated() { if ai := models.GetAIById(c, common.MustDecodeKey(c.Vars["ai_id"])); ai != nil && ai.Owner == c.User.Email { c.RenderJSON(ai.GetErrors(c)) } } }