فهرست منبع

fix: Spread link query if multiple multiple arguments are provided

marvin-wtt 1 سال پیش
والد
کامیت
e2bc896041
1فایلهای تغییر یافته به همراه1 افزوده شده و 3 حذف شده
  1. 1 3
      server/queries/link.queries.js

+ 1 - 3
server/queries/link.queries.js

@@ -46,9 +46,7 @@ async function total(match, params) {
   let query = knex("links");
 
   Object.entries(normalizeMatch(match)).forEach(([key, value]) => {
-    query = Array.isArray(value)
-      ? query.where(key, ...value)
-      : query.where(key, value);
+    query.andWhere(key, ...(Array.isArray(value) ? value : [value]));
   });
 
   if (params?.search) {