Browse Source

🐞 fix: 修复仓库搜索无效的问题

Pchen. 2 months ago
parent
commit
26fc1ad20b
1 changed files with 3 additions and 1 deletions
  1. 3 1
      apis/Repos/GetRepoList.js

+ 3 - 1
apis/Repos/GetRepoList.js

@@ -31,7 +31,7 @@ class GetRepoList extends API {
                 ...BaseStdResponse.ACCESS_DENIED
             })
 
-        let sql = 'SELECT id, name, url, create_time, state, logo, update_time FROM repos WHERE create_user = ? ORDER BY update_time DESC'
+        let sql = 'SELECT id, name, url, create_time, state, logo, update_time FROM repos WHERE create_user = ?'
         let params = [uuid]
 
         if ((keyword ?? '').trim() !== '') {
@@ -39,6 +39,8 @@ class GetRepoList extends API {
             params.push(`%${keyword}%`)
         }
 
+        sql += ' ORDER BY update_time DESC'
+
         let rows = await db.query(sql, params)
 
         if (!rows || rows.length === 0)