Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb339ccc49 |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "shrimp-server",
|
"name": "shrimp-server",
|
||||||
"version": "0.6.7",
|
"version": "0.6.8",
|
||||||
"description": "Shrimp 框架后端 — 声明式字段驱动的 Node.js 管理后台框架(Express + Mongoose + JWT)",
|
"description": "Shrimp 框架后端 — 声明式字段驱动的 Node.js 管理后台框架(Express + Mongoose + JWT)",
|
||||||
"main": "dist/main/index.js",
|
"main": "dist/main/index.js",
|
||||||
"types": "dist/main/index.d.ts",
|
"types": "dist/main/index.d.ts",
|
||||||
|
|||||||
@@ -300,6 +300,11 @@ export class ShrimpTableModule<T, P extends ITableCrudProto<T> = ITableCrudProto
|
|||||||
const stringLikeTypes = new Set(['string', 'textarea'])
|
const stringLikeTypes = new Set(['string', 'textarea'])
|
||||||
const where: Record<string, IShrimpCondition> = {}
|
const where: Record<string, IShrimpCondition> = {}
|
||||||
for (const [key, value] of Object.entries(filter)) {
|
for (const [key, value] of Object.entries(filter)) {
|
||||||
|
// _id 始终放行精确过滤(单项查看/relation 跳转用),无需配 filterable
|
||||||
|
if (key === '_id') {
|
||||||
|
if (value != null && value !== '') where['_id'] = { eq: value }
|
||||||
|
continue
|
||||||
|
}
|
||||||
const field = filterableFields.get(key)
|
const field = filterableFields.get(key)
|
||||||
if (!field) continue
|
if (!field) continue
|
||||||
if (value == null) continue
|
if (value == null) continue
|
||||||
|
|||||||
Reference in New Issue
Block a user