Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
sopyb committed Sep 15, 2023
2 parents 2618f12 + 2d74ff6 commit b813690
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "navigo-learn-api",
"version": "2.0.3",
"version": "2.0.4",
"description": "Navigo Learn API",
"repository": "https://github.com/NavigoLearn/API.git",
"author": "Navigo",
Expand Down
9 changes: 7 additions & 2 deletions src/util/Database/ExploreDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,17 @@ class ExploreDB extends Database {
): unknown[] {
const params = [];

if (!isCountQuery) {
if (!isCountQuery && userid) {
params.push(userid);
}

params.push(`%${search}%`, `%${search}%`);
params.push(Array.isArray(topic) ? topic.map((t) => t.toString()) : topic);

if (Array.isArray(topic)) {
params.push(...topic);
} else {
params.push(topic);
}

if (!isCountQuery) {
params.push((page - 1) * limit, limit);
Expand Down

0 comments on commit b813690

Please sign in to comment.