Skip to content

Commit 0fca034

Browse files
chore: remove formdata from update at
1 parent 1e6c497 commit 0fca034

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

functions/lib/buzzlead/update-conversions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const axios = require('axios')
2-
const FormData = require('form-data')
32
const ecomUtils = require('@ecomplus/utils')
43

54
const parseStatus = status => {
@@ -21,16 +20,17 @@ module.exports = async ({ appSdk, storeId, auth }, order, appData) => {
2120
const conversionStatus = parseStatus(order.financial_status && order.financial_status.current)
2221
async function updateConversion() {
2322
const url = `https://app.buzzlead.com.br/api/service/${email}/bonus/status/${orderNumber}/${conversionStatus} `; // Replace with the actual endpoint URL
24-
const form = new FormData();
23+
const data = {
24+
25+
}
2526
if (conversionStatus === 'pendente' || conversionStatus === 'cancelado') {
26-
form.append('reason', 'Cliente não realizou ação de pagamento')
27+
data['reason'] = 'Cliente não realizou ação de pagamento'
2728
}
2829

2930
const headers = {
3031
'x-api-token-buzzlead': token, // Replace with your actual API token
3132
'x-api-key-buzzlead': api_key, // Replace with your actual API key
32-
'Content-Type': 'multipart/form-data',
33-
...form.getHeaders() // This will set the correct Content-Type and boundary for the multipart/form-data
33+
'Content-Type': 'applications/json'
3434
};
3535

3636
try {

0 commit comments

Comments
 (0)