diff --git a/src/integrations/humaans/index.ts b/src/integrations/humaans/index.ts index 6b37328d..ea8e108e 100644 --- a/src/integrations/humaans/index.ts +++ b/src/integrations/humaans/index.ts @@ -113,12 +113,13 @@ class Humaans extends Integration { personId: string, customFieldId: string ): Promise { - return ( - (await this.makePaginatedRequest('/custom-values', { - personId, - customFieldId, - }).then(fp.first)) || null - ) + return await this.makePaginatedRequest('/custom-values', { + personId, + customFieldId, + }).then((xs) => { + if (!xs.length) return null + return xs.sort(fp.sortBy('updatedAt', 'desc'))[0] + }) } } diff --git a/src/integrations/humaans/types.ts b/src/integrations/humaans/types.ts index 858aecb2..92d60346 100644 --- a/src/integrations/humaans/types.ts +++ b/src/integrations/humaans/types.ts @@ -77,4 +77,6 @@ export type CustomValue = { value: string personId: string customFieldId: string + createdAt: Date + updatedAt: Date }