From a32ff72dfe0c2aba3e51bd9536d5e11a30a9d73d Mon Sep 17 00:00:00 2001 From: Emiliano Ciavatta Date: Wed, 15 Apr 2020 12:10:21 +0200 Subject: Add rules_manager tests --- routes.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'routes.go') diff --git a/routes.go b/routes.go index 111dd78..4599b8f 100644 --- a/routes.go +++ b/routes.go @@ -57,8 +57,10 @@ func ApplicationRoutes(engine *gin.Engine, rulesManager RulesManager) { return } - updated := rulesManager.UpdateRule(c, id, rule) - if !updated { + updated, err := rulesManager.UpdateRule(c, id, rule) + if err != nil { + badRequest(c, err) + } else if !updated { notFound(c, UnorderedDocument{"id": id}) } else { success(c, rule) -- cgit v1.2.3-70-g09d2