Skip to content

Commit

Permalink
frontend configured for our new backend
Browse files Browse the repository at this point in the history
  • Loading branch information
franfreezy committed Dec 9, 2024
1 parent a74bd1c commit f978eb0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions logistics/frontend/SiteFrontend/src/pages/@auth/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Login = () => {
setError("");
try {
const response = await fetch(
"https://cklogisticsco.onrender.com/backend/login/",
"https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/login/",
{
method: "POST",
headers: {
Expand Down Expand Up @@ -70,7 +70,7 @@ const Login = () => {

try {
const response = await fetch(
"https://cklogisticsco.onrender.com/backend/forgot-password/",
"https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/forgot-password/",
{
method: "POST",
headers: {
Expand Down
2 changes: 1 addition & 1 deletion logistics/frontend/SiteFrontend/src/pages/@auth/signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Signup() {

try {
const response = await fetch(
"https://cklogisticsco.onrender.com/backend/register/",
"https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/register/",
{
method: "POST",
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Header = () => {
if (!refreshToken) throw new Error("Refresh token is missing");

const response = await axios.post(
"https://cklogisticsco.onrender.com/backend/token/refresh/",
"https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/token/refresh/",
{ refresh: refreshToken },
{ headers: { "Content-Type": "application/json" } }
);
Expand Down Expand Up @@ -113,7 +113,7 @@ const Header = () => {
let accessToken = localStorage.getItem("accessToken");

let response = await axios.post(
"https://cklogisticsco.onrender.com/backend/create-order/",
"https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/create-order/",
dataToSend,
{
headers: {
Expand All @@ -134,7 +134,7 @@ const Header = () => {
if (newAccessToken) {
try {
const response = await axios.post(
"https://cklogisticsco.onrender.com/backend/create-order/",
"https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/create-order/",
dataToSend,
{
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const MapSection = ({ order, statuss }) => {

// Fetch order data
const { data } = await axios.get(
`https://cklogisticsco.onrender.com/backend/order/${order}/coordinates/`
`https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/order/${order}/coordinates/`
);
const { origin, destination, checkpoints } = data;

Expand Down Expand Up @@ -114,7 +114,7 @@ const MapSection = ({ order, statuss }) => {

// Fetch live coordinates
const liveResponse = await axios.get(
`https://cklogisticsco.onrender.com/backend/coordinates/?order_id=${order}`
`https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/coordinates/?order_id=${order}`
);
const liveCoordinates = liveResponse.data.coordinates.map((coord) => [
coord.longitude,
Expand Down Expand Up @@ -186,13 +186,13 @@ const MapSection = ({ order, statuss }) => {
) {
setStatus("completed");
await axios.post(
`https://cklogisticsco.onrender.com/backend/order/${order}/status/`,
`https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/order/${order}/status/`,
{ status: "Completed" }
);
} else {
setStatus("active");
await axios.post(
`https://cklogisticsco.onrender.com/backend/order/${order}/status/`,
`https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/order/${order}/status/`,
{ status: "Active" }
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const OrderList = ({ activeOrderId, setActiveOrderId, setActiveOrder }) => {
throw new Error("No refresh token found");
}
const response = await axios.post(
"https://cklogisticsco.onrender.com/backend/token/refresh/",
"https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/token/refresh/",
{ refresh: refreshToken },
{ headers: { "Content-Type": "application/json" } }
);
Expand All @@ -110,7 +110,7 @@ const OrderList = ({ activeOrderId, setActiveOrderId, setActiveOrder }) => {
}

const response = await axios.get(
"https://cklogisticsco.onrender.com/backend/trucks/",
"https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/trucks/",
{
headers: {
Authorization: `Bearer ${token}`,
Expand All @@ -125,7 +125,7 @@ const OrderList = ({ activeOrderId, setActiveOrderId, setActiveOrder }) => {
try {
const newAccessToken = await refreshAccessToken();
const response = await axios.get(
"https://cklogisticsco.onrender.com/backend/trucks/",
"https://https://cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net/backend/trucks/",
{
headers: {
Authorization: `Bearer ${newAccessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion logistics/logistics/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'cklogisticsco.onrender.com',
'localhost',
'127.0.0.1',
'cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net']
'cklogistics-h9bxfpgsaqf3duab.canadacentral-01.azurewebsites.net',]
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
Expand Down

0 comments on commit f978eb0

Please sign in to comment.