Skip to content

Commit 61866fb

Browse files
committed
Added "type" in response in getCustomFields()
1 parent 7bb1e15 commit 61866fb

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,19 +389,21 @@ const resp = await loops.getCustomFields();
389389

390390
#### Response
391391

392-
This method will return a list of custom field objects containing `key` and `label` attributes.
392+
This method will return a list of custom field objects containing `key`, `label` and `type` attributes.
393393

394-
If there are no custom fields, an empty list will be returned.
394+
If your account has no custom fields, an empty list will be returned.
395395

396396
```json
397397
[
398398
{
399399
"key": "favoriteColor",
400-
"label": "Favourite Color"
400+
"label": "Favorite Color",
401+
"type": "string"
401402
},
402403
{
403404
"key": "plan",
404-
"label": "Plan"
405+
"label": "Plan",
406+
"type": "string"
405407
}
406408
]
407409
```
@@ -410,6 +412,7 @@ If there are no custom fields, an empty list will be returned.
410412

411413
## Version history
412414

415+
- `v0.1.5` (Jan 25, 2023) - `getCustomFields()` now returns `type` values for each contact property.
413416
- `v0.1.4` (Jan 25, 2023) - Added support for `userId` in [`sendEvent()`](#sendevent) request. Added missing error response type for `sendEvent()` requests.
414417
- `v0.1.3` (Dec 8, 2023) - Added support for transactional attachments.
415418
- `v0.1.2` (Dec 6, 2023) - Improved transactional error types.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export default class LoopsClient {
327327
*
328328
* @returns List of custom fields (JSON)
329329
*/
330-
async getCustomFields(): Promise<Record<string, string>[]> {
330+
async getCustomFields(): Promise<Record<"key" | "label" | "type", string>[]> {
331331
return this._makeQuery({
332332
path: "v1/contacts/customFields",
333333
});

0 commit comments

Comments
 (0)