Supplier academy and small script organization.

This commit is contained in:
Norm Rasmussen
2025-06-26 15:42:12 -04:00
parent ec552f2e1a
commit 35d363af4e
2 changed files with 10 additions and 5 deletions

View File

@ -312,7 +312,7 @@ document.addEventListener("DOMContentLoaded", () => {
alert("Please choose if you are doing business with Walmart."); alert("Please choose if you are doing business with Walmart.");
return; return;
} }
payload = selectedBusiness === "yes" payload = selectedBusiness === "yes"
? { group: "164ebbb5-5ad0-45d9-81ab-3b0930d63dc8", locale: "USA", id: "{{current_person.id}}" } ? { group: "164ebbb5-5ad0-45d9-81ab-3b0930d63dc8", locale: "USA", id: "{{current_person.id}}" }
: { group: "646fe445-cc88-4266-a6bd-8e28b977649e", locale: "USA", id: "{{current_person.id}}" }; : { group: "646fe445-cc88-4266-a6bd-8e28b977649e", locale: "USA", id: "{{current_person.id}}" };
break; break;
@ -334,8 +334,8 @@ document.addEventListener("DOMContentLoaded", () => {
.then(() => { .then(() => {
localStorage.setItem("modalFilled", "true"); localStorage.setItem("modalFilled", "true");
setTimeout(() => { setTimeout(() => {
location.reload(); location.reload();
}, 4000); }, 4000);
}) })
.catch(() => { .catch(() => {
alert("There was an error submitting the form."); alert("There was an error submitting the form.");
@ -356,4 +356,4 @@ document.addEventListener("DOMContentLoaded", () => {
if (loader) loader.remove(); if (loader) loader.remove();
} }
}); });
</script> </script>

View File

@ -15,14 +15,16 @@ Should the app instantiate a Globals class with the key, headers, and baseurl, a
function? function?
""" """
class ApiGlobals: class ApiGlobals:
apikey = "" apikey = ""
headers = {"accept": "application/json", "X-Api-Key": apikey } headers = {"accept": "application/json", "X-Api-Key": apikey}
baseurl = "https://api.northpass.com/v2/" baseurl = "https://api.northpass.com/v2/"
def __init__(self, apikey): def __init__(self, apikey):
self.apikey = apikey self.apikey = apikey
class ListPeople: class ListPeople:
endpoint = "people/" endpoint = "people/"
print(endpoint) print(endpoint)
@ -48,6 +50,7 @@ class ListPeople:
print("nothing exists") print("nothing exists")
response = requests.get(listpeople.endpoint, headers=client.headers) response = requests.get(listpeople.endpoint, headers=client.headers)
# class PostPeopleCustomProps: # class PostPeopleCustomProps:
# endpoint = "properties/people/bulk" # endpoint = "properties/people/bulk"
# payload = { "data": [ # payload = { "data": [
@ -58,8 +61,10 @@ class ListPeople:
# } # }
# ] } # ] }
class PostBulkInvite: class PostBulkInvite:
endpoint = "bulk/people" endpoint = "bulk/people"
setup = ApiGlobals(Apikeys.SANDATA) setup = ApiGlobals(Apikeys.SANDATA)
p = ListPeople() p = ListPeople()