mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
18 lines
394 B
TypeScript
18 lines
394 B
TypeScript
import type { CrudFilter } from "@refinedev/core";
|
|
|
|
/**
|
|
* Replace ID("id") With Appwrite ID("$id")
|
|
* @param filter Filter to replace
|
|
* @returns Filter with replaced ID
|
|
*/
|
|
export const replaceIdWithAppwriteId = (filter: CrudFilter): CrudFilter => {
|
|
if ("field" in filter && filter.field === "id") {
|
|
filter.field = "$id";
|
|
}
|
|
|
|
return {
|
|
...filter,
|
|
value: filter.value,
|
|
};
|
|
};
|