diff --git a/.github/workflows/azure-static-web-apps-lively-ground-0cd068c1e.yml b/.github/workflows/azure-static-web-apps-lively-ground-0cd068c1e.yml index ac2006c..a96ba5a 100644 --- a/.github/workflows/azure-static-web-apps-lively-ground-0cd068c1e.yml +++ b/.github/workflows/azure-static-web-apps-lively-ground-0cd068c1e.yml @@ -20,6 +20,7 @@ jobs: submodules: true lfs: false - run: npm ci + - run: npm build - name: Build And Deploy id: builddeploy uses: Azure/static-web-apps-deploy@v1 @@ -31,7 +32,7 @@ jobs: # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig app_location: "./packages/react-frontend" # App source code path api_location: "" # Api source code path - optional - output_location: "build" # Built app content directory - optional + output_location: "dist" # Built app content directory - optional ###### End of Repository/Build Configurations ###### close_pull_request_job: diff --git a/packages/express-backend/backend.js b/packages/express-backend/backend.js index 2734a9e..ea76c63 100644 --- a/packages/express-backend/backend.js +++ b/packages/express-backend/backend.js @@ -34,7 +34,7 @@ app.post( const pfp = { profilePicture: result._id }; - fetch(`safehaven307.azurewebsites.net/users/${user._id}`, { + fetch(`https://safehaven2.azurewebsites.net/users/${user._id}`, { method: "PATCH", headers: { "Content-Type": "application/json" diff --git a/packages/react-frontend/src/Components/Table.jsx b/packages/react-frontend/src/Components/Table.jsx index e8422d7..264bde5 100644 --- a/packages/react-frontend/src/Components/Table.jsx +++ b/packages/react-frontend/src/Components/Table.jsx @@ -31,7 +31,7 @@ function TableBody(props) { - + diff --git a/packages/react-frontend/src/Views/AddOrders.jsx b/packages/react-frontend/src/Views/AddOrders.jsx index 3662160..4c2eba1 100644 --- a/packages/react-frontend/src/Views/AddOrders.jsx +++ b/packages/react-frontend/src/Views/AddOrders.jsx @@ -76,13 +76,13 @@ function AddOrders() { } function fetchOrders() { - return fetch("safehaven307.azurewebsites.net/order-units", { + return fetch("https://safehaven2.azurewebsites.net/order-units", { headers: addAuthHeader() }); } function postOrderUnit(order) { - return fetch("safehaven307.azurewebsites.net/order-units", { + return fetch("https://safehaven2.azurewebsites.net/order-units", { method: "POST", headers: addAuthHeader({ "Content-Type": "application/json" @@ -92,7 +92,7 @@ function AddOrders() { } function deleteOrder(id) { - const uri = `safehaven307.azurewebsites.net/order-units/${id}`; + const uri = `https://safehaven2.azurewebsites.net/order-units/${id}`; return fetch(uri, { method: "DELETE", headers: addAuthHeader({ @@ -102,7 +102,7 @@ function AddOrders() { } function runPost(order_str) { - return fetch("safehaven307.azurewebsites.net/orders", { + return fetch("https://safehaven2.azurewebsites.net/orders", { method: "POST", headers: addAuthHeader({ "Content-Type": "application/json" diff --git a/packages/react-frontend/src/Views/EditProfile.jsx b/packages/react-frontend/src/Views/EditProfile.jsx index 7ca8116..b3e766b 100644 --- a/packages/react-frontend/src/Views/EditProfile.jsx +++ b/packages/react-frontend/src/Views/EditProfile.jsx @@ -8,7 +8,7 @@ import { useNavigate } from "react-router-dom"; function EditProfile() { const navigate = useNavigate(); function changeProfile(profile){ - fetch("safehaven307.azurewebsites.net/users/profile", { + fetch("https://safehaven2.azurewebsites.net/users/profile", { method: "POST", headers: addAuthHeader({ "Content-Type": "application/json" diff --git a/packages/react-frontend/src/Views/Inventory.jsx b/packages/react-frontend/src/Views/Inventory.jsx index 875f49d..ecbe48e 100644 --- a/packages/react-frontend/src/Views/Inventory.jsx +++ b/packages/react-frontend/src/Views/Inventory.jsx @@ -71,7 +71,7 @@ function Inventory() { } function fetchProducts() { - const promise = fetch("safehaven307.azurewebsites.net/products", { + const promise = fetch("https://safehaven2.azurewebsites.net/products", { headers: addAuthHeader() }); return promise; @@ -79,7 +79,7 @@ function Inventory() { function postProduct(product) { console.log("posting:", product); - return fetch("safehaven307.azurewebsites.net/products", { + return fetch("https://safehaven2.azurewebsites.net/products", { method: "POST", headers: addAuthHeader({ "Content-Type": "application/json" @@ -89,7 +89,7 @@ function Inventory() { } function deleteProduct(id) { - const uri = `safehaven307.azurewebsites.net/products/${id}`; + const uri = `https://safehaven2.azurewebsites.net/products/${id}`; return fetch(uri, { method: "DELETE", headers: addAuthHeader({ diff --git a/packages/react-frontend/src/Views/LoginPage.jsx b/packages/react-frontend/src/Views/LoginPage.jsx index 4678311..06814cf 100644 --- a/packages/react-frontend/src/Views/LoginPage.jsx +++ b/packages/react-frontend/src/Views/LoginPage.jsx @@ -9,7 +9,7 @@ function Login() { const navigate = useNavigate(); function authenticateUser(user) { console.log(user); - fetch("safehaven307.azurewebsites.net/login", { + fetch("https://safehaven2.azurewebsites.net/login", { method: "POST", headers: { "Content-Type": "application/json" diff --git a/packages/react-frontend/src/Views/ManageOrders.jsx b/packages/react-frontend/src/Views/ManageOrders.jsx index d32eae8..1c29873 100644 --- a/packages/react-frontend/src/Views/ManageOrders.jsx +++ b/packages/react-frontend/src/Views/ManageOrders.jsx @@ -42,14 +42,14 @@ function ManageOrders() { }; function fetchOrders() { - return fetch("safehaven307.azurewebsites.net/orders", { + return fetch("https://safehaven2.azurewebsites.net/orders", { headers: addAuthHeader() }); } function fetchSearch(search) { search = "search=" + search; - const uri = `safehaven307.azurewebsites.net/orders/?${search}`; + const uri = `https://safehaven2.azurewebsites.net/orders/?${search}`; console.log(uri); return fetch(uri, { headers: addAuthHeader() @@ -57,7 +57,7 @@ function ManageOrders() { } function deleteOrder(id) { - const uri = `safehaven307.azurewebsites.net/orders/${id}`; + const uri = `https://safehaven2.azurewebsites.net/orders/${id}`; return fetch(uri, { method: "DELETE", headers: addAuthHeader({ diff --git a/packages/react-frontend/src/Views/OrderStatistics.jsx b/packages/react-frontend/src/Views/OrderStatistics.jsx index 80cde4a..e1dfd0d 100644 --- a/packages/react-frontend/src/Views/OrderStatistics.jsx +++ b/packages/react-frontend/src/Views/OrderStatistics.jsx @@ -64,13 +64,13 @@ function Inventory() { } function fetchProducts() { - return fetch("safehaven307.azurewebsites.net/products", { + return fetch("https://safehaven2.azurewebsites.net/products", { headers: addAuthHeader() }); } function postProduct(product) { - return fetch("safehaven307.azurewebsites.net/products", { + return fetch("https://safehaven2.azurewebsites.net/products", { method: "POST", headers: addAuthHeader({ "Content-Type": "application/json" @@ -80,7 +80,7 @@ function Inventory() { } function deleteProduct(id) { - const uri = `safehaven307.azurewebsites.net/products/${id}`; + const uri = `https://safehaven2.azurewebsites.net/products/${id}`; return fetch(uri, { method: "DELETE", headers: addAuthHeader({ diff --git a/packages/react-frontend/src/Views/ProductPage.jsx b/packages/react-frontend/src/Views/ProductPage.jsx index c14a34e..84760c2 100644 --- a/packages/react-frontend/src/Views/ProductPage.jsx +++ b/packages/react-frontend/src/Views/ProductPage.jsx @@ -33,7 +33,7 @@ function ProductPage() { function fetchProduct(id) { console.log(`Fetching product with id: ${id}`); - return fetch(`safehaven307.azurewebsites.net/products/${id}`, { + return fetch(`https://safehaven2.azurewebsites.net/products/${id}`, { headers: addAuthHeader() }) .then((res) => { @@ -76,7 +76,7 @@ function ProductPage() { function patchProduct(product) { console.log("patching: ", product); - return fetch(`safehaven307.azurewebsites.net/products/${id}`, { + return fetch(`https://safehaven2.azurewebsites.net/products/${id}`, { method: "PATCH", headers: addAuthHeader({ "Content-Type": "application/json" diff --git a/packages/react-frontend/src/Views/Profile.jsx b/packages/react-frontend/src/Views/Profile.jsx index 7f17ee1..8e31f8c 100644 --- a/packages/react-frontend/src/Views/Profile.jsx +++ b/packages/react-frontend/src/Views/Profile.jsx @@ -13,19 +13,19 @@ function Profile() { useEffect(() => { async function getUser() { - const user_details = await axios.get(`safehaven307.azurewebsites.net/users`, { + const user_details = await axios.get(`https://safehaven2.azurewebsites.net/users`, { headers: addAuthHeader() }); const user = user_details.data; setUser(user); - const imageUrl = `safehaven307.azurewebsites.net/profile-picture/${user.profilePicture}`; + const imageUrl = `https://safehaven2.azurewebsites.net/profile-picture/${user.profilePicture}`; setProfilePicture(imageUrl); } async function fetchProfilePicture() { try { - const imageUrl = `safehaven307.azurewebsites.net/profile-picture/${user.profilePicture}`; + const imageUrl = `https://safehaven2.azurewebsites.net/profile-picture/${user.profilePicture}`; setProfilePicture(imageUrl); } catch (error) { console.error("Failed to load user profile picture", error); @@ -49,14 +49,14 @@ function Profile() { try { // Send the file to the server for processing and storage in MongoDB - const response = await axios.post("safehaven307.azurewebsites.net/profile-picture", formData, { + const response = await axios.post("https://safehaven2.azurewebsites.net/profile-picture", formData, { headers: addAuthHeader({ "Content-Type": "multipart/form-data" }) }); console.log(response); - const imageUrl = `safehaven307.azurewebsites.net/profile-picture/${response.data}`; + const imageUrl = `https://safehaven2.azurewebsites.net/profile-picture/${response.data}`; setProfilePicture(imageUrl); @@ -68,7 +68,7 @@ function Profile() { }; function deleteProfile() { - fetch("safehaven307.azurewebsites.net/users", { + fetch("https://safehaven2.azurewebsites.net/users", { method: "DELETE", headers: addAuthHeader({ "Content-Type": "application/json" diff --git a/packages/react-frontend/src/Views/SignUpPage.jsx b/packages/react-frontend/src/Views/SignUpPage.jsx index 869b2ad..b1e63a1 100644 --- a/packages/react-frontend/src/Views/SignUpPage.jsx +++ b/packages/react-frontend/src/Views/SignUpPage.jsx @@ -8,7 +8,7 @@ function Signup() { const navigate = useNavigate(); function createUser(user) { console.log(user); - fetch("safehaven307.azurewebsites.net/users", { + fetch("https://safehaven2.azurewebsites.net/users", { method: "POST", headers: { "Content-Type": "application/json"