Skip to content

Commit

Permalink
Fixes URL when syncing audience. Removes console.logs
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-Ag committed Jul 25, 2024
1 parent 2e1f7ac commit 48ff851
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DynamicFieldItem, DynamicFieldError, RequestClient } from '@segment/actions-core'
import { Payload } from './sync/generated-types'
import { audienceId } from '../talon-one/t1-properties'
import { createHash } from 'crypto'

const FACEBOOK_API_VERSION = 'v20.0'
Expand Down Expand Up @@ -89,17 +88,13 @@ export default class FacebookClient {
data: data
}
}
console.log('params', JSON.stringify(params))

console.log('audienceId', input.audienceId)

try {
return await this.request(`${BASE_URL}${audienceId}/users`, {
return await this.request(`${BASE_URL}${input.audienceId}/users`, {
method: 'post',
json: params
})
} catch (e) {
console.log('error', e)
return
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,8 @@ const action: ActionDefinition<Settings, Payload> = {
}
},
perform: async (request, { settings, payload, hookOutputs, syncMode }) => {
console.log('test perform')
const fbClient = new FacebookClient(request, settings.retlAdAccountId)

console.log('settings', settings)
console.log('hookOutputs', hookOutputs)
console.log('syncMode', syncMode)

if (syncMode === 'add' || syncMode === 'update' || syncMode === 'upsert') {
return await fbClient.syncAudience({
audienceId: hookOutputs?.retlOnMappingSave.audienceId,
Expand Down

0 comments on commit 48ff851

Please sign in to comment.