feat: add sub fields for address (#13566)
https://github.com/user-attachments/assets/8fe9079d-9b66-4b42-8b11-ad713e9de666 --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { FieldAddressValue } from '@/object-record/record-field/types/FieldMetadata';
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
import { AllowedAddressSubField } from 'twenty-shared/types';
|
||||
|
||||
export const joinAddressFieldValues = (
|
||||
fieldValue: FieldAddressValue,
|
||||
subFields: AllowedAddressSubField[],
|
||||
) => {
|
||||
return subFields
|
||||
.map((subField) => fieldValue[subField])
|
||||
.filter(isNonEmptyString)
|
||||
.join(',');
|
||||
};
|
||||
Reference in New Issue
Block a user