From 1e7aa5bf65078bd1cfba800d0f0dad2d69959e38 Mon Sep 17 00:00:00 2001
From: robban64 <carl@schonfelder.se>
Date: Wed, 14 Apr 2021 07:09:56 +0200
Subject: [PATCH] fix: search competitions

---
 server/app/apis/competitions.py          | 2 +-
 server/app/database/controller/search.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/app/apis/competitions.py b/server/app/apis/competitions.py
index 9e87f93a..be376206 100644
--- a/server/app/apis/competitions.py
+++ b/server/app/apis/competitions.py
@@ -54,5 +54,5 @@ class CompetitionSearch(Resource):
     @jwt_required
     def get(self):
         args = competition_search_parser.parse_args(strict=True)
-        items, total = dbc.search.user(**args)
+        items, total = dbc.search.competition(**args)
         return list_response(list_schema.dump(items), total)
diff --git a/server/app/database/controller/search.py b/server/app/database/controller/search.py
index f570176c..a2ca6b84 100644
--- a/server/app/database/controller/search.py
+++ b/server/app/database/controller/search.py
@@ -19,7 +19,7 @@ def user(email=None, name=None, city_id=None, role_id=None, page=0, page_size=15
     return query.pagination(page, page_size, order_column, order)
 
 
-def competitions(name=None, year=None, city_id=None, page=0, page_size=15, order=1, order_by=None):
+def competition(name=None, year=None, city_id=None, page=0, page_size=15, order=1, order_by=None):
     query = Competition.query
     if name:
         query = query.filter(Competition.name.like(f"%{name}%"))
-- 
GitLab