Skip to content

Commit

Permalink
fix(emailSender): replace condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihoub2 committed Jun 13, 2024
1 parent 27fcf35 commit 8fe233d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ VITE_APP_NAME="Guichet"
VITE_HEADER_TAG="dev"
VITE_HEADER_TAG_COLOR="blue-ecume"
VITE_VERSION=$npm_package_version
VITE_HEADER_TAG=Development
13 changes: 6 additions & 7 deletions src/api/send-mail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ function EmailSender({
const [userResponse, setUserResponse] = useState("");
const isDevelopment = import.meta.env.VITE_HEADER_TAG === "Development";
let basePath = "contact";
if (window.location.pathname.includes("contributionpage")) {
basePath = "contribute";
} else if (window.location.pathname.includes("apioperations")) {
basePath = "contribute_productions";
}
const brevoUrl = isDevelopment
? "https://api.brevo.com/v3/smtp/email"
: "/email/";
const scanRUrl = isDevelopment
? `https://scanr-api.dataesr.ovh/${basePath}/${contribution._id}`
: `/api/${basePath}/${contribution._id}`;

if (window.location.pathname.includes("contributionpage")) {
basePath = "contribute";
} else if (window.location.pathname.includes("apioperations")) {
basePath = "contribute_productions";
}

console.log(scanRUrl);
const [selectedProfile, setSelectedProfile] = useState("");

useEffect(() => {
Expand Down

0 comments on commit 8fe233d

Please sign in to comment.