From 35d363af4eb75d65ee568972b42d8db4e429729f Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Thu, 26 Jun 2025 15:42:12 -0400 Subject: [PATCH] Supplier academy and small script organization. --- .../Walmart Supplier Prod/_modal.html.liquid | 8 ++++---- Scripts/Organized_API/class_calls.py | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Custom_Templates/customer_templates/Walmart Supplier Prod/_modal.html.liquid b/Custom_Templates/customer_templates/Walmart Supplier Prod/_modal.html.liquid index 19e504b1..727fbc98 100644 --- a/Custom_Templates/customer_templates/Walmart Supplier Prod/_modal.html.liquid +++ b/Custom_Templates/customer_templates/Walmart Supplier Prod/_modal.html.liquid @@ -312,7 +312,7 @@ document.addEventListener("DOMContentLoaded", () => { alert("Please choose if you are doing business with Walmart."); return; } - payload = selectedBusiness === "yes" + payload = selectedBusiness === "yes" ? { group: "164ebbb5-5ad0-45d9-81ab-3b0930d63dc8", locale: "USA", id: "{{current_person.id}}" } : { group: "646fe445-cc88-4266-a6bd-8e28b977649e", locale: "USA", id: "{{current_person.id}}" }; break; @@ -334,8 +334,8 @@ document.addEventListener("DOMContentLoaded", () => { .then(() => { localStorage.setItem("modalFilled", "true"); setTimeout(() => { - location.reload(); - }, 4000); + location.reload(); + }, 4000); }) .catch(() => { alert("There was an error submitting the form."); @@ -356,4 +356,4 @@ document.addEventListener("DOMContentLoaded", () => { if (loader) loader.remove(); } }); - \ No newline at end of file + diff --git a/Scripts/Organized_API/class_calls.py b/Scripts/Organized_API/class_calls.py index 6286b3ab..6aff4581 100644 --- a/Scripts/Organized_API/class_calls.py +++ b/Scripts/Organized_API/class_calls.py @@ -15,14 +15,16 @@ Should the app instantiate a Globals class with the key, headers, and baseurl, a function? """ + class ApiGlobals: apikey = "" - headers = {"accept": "application/json", "X-Api-Key": apikey } + headers = {"accept": "application/json", "X-Api-Key": apikey} baseurl = "https://api.northpass.com/v2/" def __init__(self, apikey): self.apikey = apikey + class ListPeople: endpoint = "people/" print(endpoint) @@ -48,6 +50,7 @@ class ListPeople: print("nothing exists") response = requests.get(listpeople.endpoint, headers=client.headers) + # class PostPeopleCustomProps: # endpoint = "properties/people/bulk" # payload = { "data": [ @@ -58,8 +61,10 @@ class ListPeople: # } # ] } + class PostBulkInvite: endpoint = "bulk/people" + setup = ApiGlobals(Apikeys.SANDATA) p = ListPeople()