Hello i have setup new pipedream ac i needed few help in zohobooks api
i am using if and else in node code for zoho books
i want to use if and else can anyone please help
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
zoho_books: {
type: "app",
app: "zoho_books",
}
},
async run({steps, $}) {
if (steps.trigger.event.body.info.to_pincode === '411045' ) {
return await axios($, {
url: `https://books.${this.zoho_books.$auth.base_api_uri}/api/v3/contacts`,
headers: {
"Authorization": `Zoho-oauthtoken ${this.zoho_books.$auth.oauth_access_token}`,
},
params: {
organization_id: `${this.zoho_books.$auth.organization_id}`,
address_contains: steps.trigger.event.body.info.from_pincode,
sort_column: 'created_time',
sort_order: 'D',
},
})
} else {
return await axios($, {
url: `https://books.${this.zoho_books.$auth.base_api_uri}/api/v3/contacts`,
headers: {
"Authorization": `Zoho-oauthtoken ${this.zoho_books.$auth.oauth_access_token}`,
},
params: {
organization_id: `${this.zoho_books.$auth.organization_id}`,
address_contains: steps.trigger.event.body.info.to_pincode,
sort_column: 'created_time',
sort_order: 'D',
},
})
}
},
})