Skip to content

Commit

Permalink
Merge pull request #15 from GlideRide-online/patch-01
Browse files Browse the repository at this point in the history
added backend route secret
  • Loading branch information
Akshat2Jain authored Dec 11, 2023
2 parents 3d09985 + bf940ce commit b7dc067
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions client/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
2 changes: 1 addition & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const App = () => {
const [value, setValue] = useState(false);
const getBooleanValue = async () => {
try {
const res = await axios.get("https://glideride.onrender.com/getBooleanValue");
const res = await axios.get(`${process.env.REACT_APP_SECRETROUTE}/getBooleanValue`);
localStorage.setItem("ShowUi", res.data.booleanValue)
setValue(res.data.booleanValue);
} catch (error) {
Expand Down
5 changes: 2 additions & 3 deletions client/src/Steps/Summary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ const Summary = () => {
order_id: data.id,
handler: async (response) => {
try {
const verifyUrl =
"https://glideride.onrender.com/api/checkout/verify";
const verifyUrl = `${process.env.REACT_APP_SECRETROUTE}/api/checkout/verify`;
const { data } = await axios.post(verifyUrl, response);

if (data.success) {
Expand Down Expand Up @@ -119,7 +118,7 @@ const Summary = () => {
const handlePayment = async () => {
try {
const response = await axios.post(
"https://glideride.onrender.com/api/checkout/orders",
`${process.env.REACT_APP_SECRETROUTE}/api/checkout/orders`,
{ amount: numericValue }
);
initPayment(response.data.order);
Expand Down
18 changes: 12 additions & 6 deletions client/src/componetnts/DisableUiButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ const DisableUiButton = () => {
const handleDisable = async () => {
console.log("ui disable");
try {
const res = await axios.post("https://glideride.onrender.com/updateUi", {
booleanValue: true,
});
const res = await axios.post(
`${process.env.REACT_APP_SECRETROUTE}/updateUi`,
{
booleanValue: true,
}
);
message.success("Ui Disabled successfully");
console.log(res.data);
} catch (error) {
Expand All @@ -18,9 +21,12 @@ const DisableUiButton = () => {
const handleActivate = async () => {
console.log("Ui Activated");
try {
const res = await axios.post("https://glideride.onrender.com/updateUi", {
booleanValue: false,
});
const res = await axios.post(
`${process.env.REACT_APP_SECRETROUTE}/updateUi`,
{
booleanValue: false,
}
);
message.success("Ui Activated successfully");
console.log(res.data);
} catch (error) {
Expand Down
3 changes: 1 addition & 2 deletions client/src/pages/Booking.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Booking = ({ showUi }) => {
}, []);

const googleLogin = async () => {
window.open("https://glideride.onrender.com/auth/google", "_self");
window.open(`${process.env.REACT_APP_SECRETROUTE}/auth/google`, "_self");
};

return (
Expand Down Expand Up @@ -95,7 +95,6 @@ const Booking = ({ showUi }) => {
)}
</>
)}
Hiii
</>
);
};
Expand Down

0 comments on commit b7dc067

Please sign in to comment.