Skip to content
Snippets Groups Projects
Unverified Commit 9ce2291e authored by Kevin Aleman's avatar Kevin Aleman Committed by GitHub
Browse files

Regression: Fix sort param on omnichannel endpoints (#23789)

parent 194a600f
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ export const useAgentsList = (
...(options.text && { text: options.text }),
offset: start,
count: end + start,
sort: `{ name: 1 }`,
sort: `{ "name": 1 }`,
});
const items = agents.map((agent: any) => {
......
......@@ -40,7 +40,7 @@ export const useDepartmentsList = (
text: options.filter,
offset: start,
count: end + start,
sort: `{ name: 1 }`,
sort: `{ "name": 1 }`,
});
const items = departments
......
......@@ -42,7 +42,7 @@ const CustomEmoji: FC<CustomEmojiProps> = function CustomEmoji({ onClick, reload
useMemo(
() => ({
query: JSON.stringify({ name: { $regex: text || '', $options: 'i' } }),
sort: `{ ${sortBy}: ${sortDirection === 'asc' ? 1 : -1} }`,
sort: `{ "${sortBy}": ${sortDirection === 'asc' ? 1 : -1} }`,
count: itemsPerPage,
offset: current,
}),
......
export type PaginatedRequest<T = {}, S extends string = string> = {
count?: number;
offset?: number;
sort?: `{ ${S}: ${1 | -1} }` | string;
sort?: `{ "${S}": ${1 | -1} }` | string;
} & T;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment