Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added backend route secret #15

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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