mirror of
https://github.com/directus/directus.git
synced 2026-01-31 23:18:03 -05:00
Finish translations
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { Filter, Accountability } from '../types';
|
||||
import { deepMap } from './deep-map';
|
||||
import { toArray } from '../utils/to-array';
|
||||
|
||||
export function parseFilter(filter: Filter, accountability: Accountability | null) {
|
||||
return deepMap(filter, (val: any, key: string) => {
|
||||
if (val === 'true') return true;
|
||||
if (val === 'false') return false;
|
||||
|
||||
if (key === '_in' || key === '_nin') return val.split(',').filter((val: any) => val);
|
||||
if (key === '_in' || key === '_nin') return toArray(val);
|
||||
|
||||
if (val === '$NOW') return new Date();
|
||||
if (val === '$CURRENT_USER') return accountability?.user || null;
|
||||
|
||||
Reference in New Issue
Block a user