update: add bearer before authorize header before token value

This commit is contained in:
mahyargdz
2024-12-02 14:28:11 +03:30
parent ef9228f13f
commit 5c1773b51d
3 changed files with 12 additions and 10 deletions
+6 -6
View File
@@ -61,7 +61,7 @@ const panatechAxiosConfig = () => {
return {
baseURL: panatechBaseUrl,
headers: {
Authorization: panatechToken
Authorization: `Bearer ${panatechToken}`
}
}
}
@@ -99,7 +99,7 @@ module.exports.saveTransactionToArpa = (data, items, db) => {
// "Data": {"TransactionID": null, "BusinessID": 3, "DocAliasId": 144, "Description": "تست", "cAddress1": "تهران", "cTel1": "0218884455", "TransCCustom1": "آقای موسوی"},
// "Items": [{"TransLineID": null, "itemId": 5302, "MjQty": 20, "StockAreaId": 1}, {"TransLineID": null, "itemId": 5302, "MjQty": 20, "StockAreaId": 1}]
// }
return new Promise(async (resolve, reject) => {
try {
const transaction = await axios.post('/api/NewTransaction', ArpaData, axiosConfig(db))
@@ -141,7 +141,7 @@ module.exports.saveUserToArpa = (userData, db) => {
businessCode: ArpaID.data.data.BusinessCode
})
} catch (e) {
// console.log(e)
// console.log(e)
reject(e)
}
@@ -165,16 +165,16 @@ module.exports.updateUserOnArpa = (userData, arpa_businessID, db) => {
BusinessID: arpa_businessID,
CheckExistNationalCode: true
}
console.log(data)
console.log(data)
return new Promise(async (resolve, reject) => {
try {
const ArpaUpdate = await axios.post('/api/putBusiness', data, axiosConfig(db))
console.log(ArpaUpdate)
console.log(ArpaUpdate)
if (!ArpaUpdate.data.status) reject(new Error('Cant update user -- There is a problem in ArpaWebService'))
resolve('updated successfully')
} catch (e) {
console.log(e)
console.log(e)
reject(e)
}