fix(server): add missing searchRoles to Item model

Add searchRoles static property to enable searching items by name and code.
This fixes the 500 Internal Server Error when searching items via
/api/items?search_keyword=...

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Ahmed Bouhuolia
2026-02-09 13:40:34 +02:00
parent c47acdee03
commit 1972861c97

View File

@@ -70,6 +70,16 @@ export class Item extends TenantBaseModel {
};
}
/**
* Model search roles.
*/
static get searchRoles() {
return [
{ condition: 'or', fieldKey: 'name', comparator: 'contains' },
{ condition: 'or', fieldKey: 'code', comparator: 'like' },
];
}
/**
* Relationship mapping.
*/