From 13ddf44003044c3df95ec1c69a5e85917f1275c0 Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Mon, 11 Nov 2024 08:08:20 +0530 Subject: [PATCH 1/2] use plugin data from db for review --- backend/routers/plugins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/routers/plugins.py b/backend/routers/plugins.py index da5b0dfc5..26c2c67be 100644 --- a/backend/routers/plugins.py +++ b/backend/routers/plugins.py @@ -69,7 +69,7 @@ def review_plugin(plugin_id: str, data: dict, uid: str = Depends(auth.get_curren if 'score' not in data: raise HTTPException(status_code=422, detail='Score is required') - plugin = next(filter(lambda x: x.id == plugin_id, get_plugins_data(uid)), None) + plugin = next(filter(lambda x: x.id == plugin_id, get_plugins_data_from_db(uid)), None) if not plugin: raise HTTPException(status_code=404, detail='Plugin not found') From 0366844ae9845b6d337e8c5052b181c931bc3e14 Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Mon, 11 Nov 2024 08:11:39 +0530 Subject: [PATCH 2/2] fetch directly the specific plugin --- backend/routers/plugins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/routers/plugins.py b/backend/routers/plugins.py index 26c2c67be..292ad673c 100644 --- a/backend/routers/plugins.py +++ b/backend/routers/plugins.py @@ -69,7 +69,7 @@ def review_plugin(plugin_id: str, data: dict, uid: str = Depends(auth.get_curren if 'score' not in data: raise HTTPException(status_code=422, detail='Score is required') - plugin = next(filter(lambda x: x.id == plugin_id, get_plugins_data_from_db(uid)), None) + plugin = get_plugin_by_id_db(plugin_id, uid) if not plugin: raise HTTPException(status_code=404, detail='Plugin not found')