diff --git a/src/taskpane/taskpane.js b/src/taskpane/taskpane.js index dc1a91f..ee9c5f0 100644 --- a/src/taskpane/taskpane.js +++ b/src/taskpane/taskpane.js @@ -9,10 +9,10 @@ import axios from "axios"; // axios conf axios.defaults.headers.common["api-language"] = "nl"; -const localApiUrl = "https://bykhztyhjw.sharedwithexpose.com/api/zoek_bestelling"; -const orderUrlEdit = "https://bykhztyhjw.sharedwithexpose.com/bestellingen/edit/"; -const orderUrlIndex = "https://bykhztyhjw.sharedwithexpose.com/bestellingen"; -const apiCredentialUrl = "https://bykhztyhjw.sharedwithexpose.com/api/api_credentials"; +const localApiUrl = "https://backoffice.sociale-controle.nl/api/zoek_bestelling"; +const orderUrlEdit = "https://backoffice.sociale-controle.nl/bestellingen/edit/"; +const orderUrlIndex = "https://backoffice.sociale-controle.nl/bestellingen"; +const apiCredentialUrl = "https://backoffice.sociale-controle.nl/api/api_credentials"; Office.onReady((info) => { if (info.host === Office.HostType.Outlook) { @@ -25,25 +25,20 @@ export async function run() { // Set load animation in button loadAnimation(true); - // btoa(getLastName(Office.context.mailbox.item.sender.displayName)) - // btoa(getInitials(Office.context.mailbox.item.sender.displayName)) - // btoa(Office.context.mailbox.item.sender.emailAddress) - //senderName: btoa(Office.context.mailbox.item.sender.displayName) - let searchInfo = { - senderLastName: btoa("DIT BESTAAT SWS NIET"), - senderInitials: btoa("NAHH"), - senderName: btoa("NO WAY DAT DIT BESTAAT!"), - senderEmail: btoa("Anjameijer1958@outlook.com"), + senderLastName: btoa(getLastName(Office.context.mailbox.item.sender.displayName)), + senderInitials: btoa(getInitials(Office.context.mailbox.item.sender.displayName)), + senderName: btoa(Office.context.mailbox.item.sender.displayName), + senderEmail: btoa(Office.context.mailbox.item.sender.emailAddress), senderSubject: btoa(Office.context.mailbox.item.subject), - postalCodes: btoa(["1234AA, 0910AA"]), + postalCodes: {}, }; - // searchInfo.postalCodes = await new Promise((resolve) => { - // Office.context.mailbox.item.body.getAsync("text", function (async) { - // resolve(getPostalCodesFromText(async.value)); - // }); - // }); + searchInfo.postalCodes = await new Promise((resolve) => { + Office.context.mailbox.item.body.getAsync("text", function (async) { + resolve(getPostalCodesFromText(async.value)); + }); + }); // Make API call to see if we can find an order for the e-mail. let results;