Skip to content

Commit 211354c

Browse files
correcting reddit oauth to managed (#2453)
1 parent cae15b2 commit 211354c

File tree

1 file changed

+17
-14
lines changed
  • packages/destination-actions/src/destinations/reddit-audiences

1 file changed

+17
-14
lines changed

packages/destination-actions/src/destinations/reddit-audiences/index.ts

+17-14
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const destination: AudienceDestinationDefinition<Settings, AudienceSettings> = {
88
slug: 'actions-reddit-audiences',
99
mode: 'cloud',
1010
authentication: {
11-
scheme: 'oauth2',
11+
scheme: 'oauth-managed',
1212
fields: {
1313
ad_account_id: {
1414
type: 'string',
@@ -53,20 +53,23 @@ const destination: AudienceDestinationDefinition<Settings, AudienceSettings> = {
5353
full_audience_sync: false
5454
},
5555
async createAudience(request, createAudienceInput) {
56-
const response = await request<CreateAudienceResp>(`https://ads-api.reddit.com/api/v3/ad_accounts/${createAudienceInput.settings.ad_account_id}/custom_audiences`, {
57-
method: 'POST',
58-
headers: {
59-
'Content-Type': 'application/json'
60-
},
61-
json: {
62-
data: {
63-
name: createAudienceInput.audienceName,
64-
type: 'CUSTOMER_LIST'
65-
}
66-
} as CreateAudienceReq
67-
})
56+
const response = await request<CreateAudienceResp>(
57+
`https://ads-api.reddit.com/api/v3/ad_accounts/${createAudienceInput.settings.ad_account_id}/custom_audiences`,
58+
{
59+
method: 'POST',
60+
headers: {
61+
'Content-Type': 'application/json'
62+
},
63+
json: {
64+
data: {
65+
name: createAudienceInput.audienceName,
66+
type: 'CUSTOMER_LIST'
67+
}
68+
} as CreateAudienceReq
69+
}
70+
)
6871
const jsonOutput = await response.json()
69-
return { externalId: (jsonOutput.data.id) }
72+
return { externalId: jsonOutput.data.id }
7073
},
7174
async getAudience(_, getAudienceInput) {
7275
return {

0 commit comments

Comments
 (0)