Skip to content

Commit f42a763

Browse files
committed
fix(ketch): wire optional purposes filter for get_consent operation
1 parent 166f53b commit f42a763

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

apps/sim/blocks/blocks/ketch.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ export const KetchBlock: BlockConfig<KetchResponse> = {
7474
language: 'json',
7575
required: true,
7676
},
77+
{
78+
id: 'purposesFilter',
79+
title: 'Purposes Filter',
80+
type: 'code',
81+
placeholder: '{"analytics": {}, "marketing": {}}',
82+
language: 'json',
83+
condition: { field: 'operation', value: 'get_consent' },
84+
mode: 'advanced',
85+
},
7786
{
7887
id: 'purposes',
7988
title: 'Purposes',
@@ -164,6 +173,13 @@ export const KetchBlock: BlockConfig<KetchResponse> = {
164173
: params.identities
165174
}
166175

176+
if (params.operation === 'get_consent' && params.purposesFilter) {
177+
result.purposes =
178+
typeof params.purposesFilter === 'string'
179+
? JSON.parse(params.purposesFilter)
180+
: params.purposesFilter
181+
}
182+
167183
if (params.operation === 'set_consent' && params.purposes) {
168184
result.purposes =
169185
typeof params.purposes === 'string' ? JSON.parse(params.purposes) : params.purposes

0 commit comments

Comments
 (0)