Skip to content

Commit b646fd5

Browse files
Copilothotlong
andcommitted
fix: convert OData string filters to proper object format in dataSource.find calls
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 7e63e1d commit b646fd5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

apps/console/src/components/ObjectView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function DrawerDetailContent({ objectDef, recordId, dataSource, onEdit }: {
6868
useEffect(() => {
6969
if (!dataSource || !objectDef?.name || !recordId) return;
7070
const threadId = `${objectDef.name}:${recordId}`;
71-
dataSource.find('sys_comment', { $filter: `threadId eq '${threadId}'`, $orderby: 'createdAt asc' })
71+
dataSource.find('sys_comment', { $filter: { threadId }, $orderby: { createdAt: 'asc' } })
7272
.then((res: any) => {
7373
if (res.data?.length) {
7474
setFeedItems(res.data.map((c: any) => ({

apps/console/src/components/RecordDetailView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ export function RecordDetailView({ dataSource, objects, onEdit }: RecordDetailVi
178178
const threadId = `${objectName}:${pureRecordId}`;
179179

180180
// Fetch record viewers
181-
dataSource.find('sys_presence', { $filter: `recordId eq '${pureRecordId}'` })
181+
dataSource.find('sys_presence', { $filter: { recordId: pureRecordId } })
182182
.then((res: any) => { if (res.data?.length) setRecordViewers(res.data); })
183183
.catch(() => {});
184184

185185
// Fetch persisted comments and map to FeedItem[]
186-
dataSource.find('sys_comment', { $filter: `threadId eq '${threadId}'`, $orderby: 'createdAt asc' })
186+
dataSource.find('sys_comment', { $filter: { threadId }, $orderby: { createdAt: 'asc' } })
187187
.then((res: any) => {
188188
if (res.data?.length) {
189189
setFeedItems(res.data.map((c: any) => ({

0 commit comments

Comments
 (0)