Skip to content

Commit

Permalink
fix(ci): change url location for email
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihoub2 committed May 22, 2024
1 parent 6124407 commit 7800f3c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
42 changes: 21 additions & 21 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
server {
listen 5173;
resolver 8.8.8.8;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
location ~ ^/api/(.*)$ {
proxy_pass https://scanr-api.dataesr.ovh/$1$is_args$args;
proxy_set_header Authorization 'Basic $VITE_SCANR_API_AUTHORIZATION';
proxy_set_header Accept application/json;
proxy_set_header Content-Type application/json;
client_max_body_size 10M;
}
location /email/ {
proxy_set_header accept application/json;
proxy_set_header api-key $VITE_BREVO_API_AUTHORIZATION;
proxy_set_header content-type application/json;
proxy_ssl_server_name on;
proxy_pass https://api.brevo.com/v3/smtp/email;
}
listen 5173;
resolver 8.8.8.8;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
location ~ ^/api/(.*)$ {
proxy_pass https://scanr-api.dataesr.ovh/$1$is_args$args;
proxy_set_header Authorization 'Basic $VITE_SCANR_API_AUTHORIZATION';
proxy_set_header Accept application/json;
proxy_set_header Content-Type application/json;
client_max_body_size 10M;
}
location /email/ {
proxy_set_header accept application/json;
proxy_set_header api-key $VITE_BREVO_API_AUTHORIZATION;
proxy_set_header content-type application/json;
proxy_ssl_server_name on;
proxy_pass https://api.brevo.com/v3/smtp/email;
}
}
2 changes: 1 addition & 1 deletion src/api/send-mail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function EmailSender({ contribution }: { contribution: Contribution }) {
htmlContent: userResponse,
};

const response = await fetch("https://api.brevo.com/v3/smtp/email", {
const response = await fetch("/email/", {
method: "POST",
headers: {
"api-key": import.meta.env.VITE_BREVO_API_AUTHORIZATION,
Expand Down
3 changes: 2 additions & 1 deletion src/api/utils/buildURL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const buildURL = (
const baseUrl = location.pathname.includes("contributionpage")
? "contribute"
: "contact";

const sorted = sort === "ASC" ? "sort=created_at" : "sort=-created_at";
const where: any = {};
if (query.trim() !== "") {
Expand All @@ -27,5 +28,5 @@ export const buildURL = (
const whereQuery =
Object.keys(where).length > 0 ? `&where=${JSON.stringify(where)}` : "";

return `/api/${baseUrl}?${sorted}&page=${page}&max_results=20${whereQuery}`;
return `https://scanr-api.dataesr.ovh/${baseUrl}?${sorted}&page=${page}&max_results=20${whereQuery}`;
};
2 changes: 1 addition & 1 deletion src/layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function MainFooter() {
return (
<Footer fluid={true}>
<FooterTop>
<Container>Le Guichet Numérique du DIST</Container>
<Container>Le Guichet Numérique du DISD</Container>
</FooterTop>
<FooterBody>
<Logo
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ContributionsGraphByName from "../../components/graphs/contributions-by-n
const Home = () => {
return (
<Container className="fr-mt-10v">
<h1>Bienvenue sur le Guichet numérique du DIST</h1>
<h1>Bienvenue sur le Guichet numérique du DISD</h1>
<Row gutters className="fr-grid-row--center fr-mt-5w">
<Col>
<ContributionsGraphByYear />
Expand Down

0 comments on commit 7800f3c

Please sign in to comment.