Skip to content

Commit

Permalink
Merge pull request #160 from konecty/fix/phone-number-to-string
Browse files Browse the repository at this point in the history
Fix: transform phoneNumber to string on find
  • Loading branch information
7sete7 authored Jul 8, 2024
2 parents 7dbadae + ea08bde commit 17c225b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/imports/data/filterUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ export function parseFilterCondition(condition, metaObject, { user }, invert) {
return parseInt(value);
}
break;
case "phone.phoneNumber":
if (value && !isString(value)) {
return value.toString();
}
break;
}
return value;
};
Expand Down
3 changes: 2 additions & 1 deletion src/server/routes/rest/stream/streamApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import isString from 'lodash/isString';

import { getAuthTokenIdFromReq } from '@imports/utils/sessionUtils';

import { find } from '@imports/data/data';
import { find } from '@imports/data/api';

export const streamApi: FastifyPluginCallback = (fastify, _, done) => {
fastify.get<{
Expand All @@ -31,6 +31,7 @@ export const streamApi: FastifyPluginCallback = (fastify, _, done) => {
start: req.query.start,
withDetailFields: req.query.withDetailFields,
getTotal: true,
asStream: true,
tracingSpan,
} as any);

Expand Down

0 comments on commit 17c225b

Please sign in to comment.