Fixed Paginated Search
This commit is contained in:
@@ -53,4 +53,20 @@ export async function findCustomerOrContactByEmailOrDomain(server:FastifyInstanc
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export function getNestedValue(obj: any, path: string): any {
|
||||
return path.split('.').reduce((acc, part) => acc?.[part], obj);
|
||||
}
|
||||
|
||||
export function compareValues(a: any, b: any): number {
|
||||
if (a === b) return 0;
|
||||
if (a == null) return 1;
|
||||
if (b == null) return -1;
|
||||
|
||||
if (typeof a === 'string' && typeof b === 'string') {
|
||||
return a.localeCompare(b);
|
||||
}
|
||||
|
||||
return a < b ? -1 : 1;
|
||||
}
|
||||
Reference in New Issue
Block a user