Skip to content

Commit

Permalink
fix(ticket-office): update url to fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihoub2 committed Oct 7, 2024
1 parent 7412a29 commit cff41e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
19 changes: 8 additions & 11 deletions client/src/components/contact-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,14 @@ export default function ContactForm({ objectId, objectType }: Props) {
if (api === "contribute") {
payload = { ...payload, objectId, objectType };
}
const resp = await fetch(
`https://ticket-office.staging.dataesr.ovh/api/${api}`,
{
method: "POST",
body: JSON.stringify(payload),
headers: {
"Content-Type": "application/json",
...postHeadersTicketOffice,
},
}
);
const resp = await fetch(`/ticket/api/${api}`, {
method: "POST",
body: JSON.stringify(payload),
headers: {
"Content-Type": "application/json",
...postHeadersTicketOffice,
},
});

if (resp.status !== 200) throw new Error("error");
return resp.json();
Expand Down
19 changes: 8 additions & 11 deletions client/src/pages/suggest/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,14 @@ export default function Suggest() {
},
productions: items.map((item) => ({ id: item.id })),
};
const resp = await fetch(
"https://ticket-office.staging.dataesr.ovh/api/production",
{
method: "POST",
body: JSON.stringify(body),
headers: {
"Content-Type": "application/json",
...postHeadersTicketOffice,
},
}
);
const resp = await fetch("/ticket/api/production", {
method: "POST",
body: JSON.stringify(body),
headers: {
"Content-Type": "application/json",
...postHeadersTicketOffice,
},
});
const json = await resp.json();
if (json?.status === "ERR") {
setErrorSubmission(true);
Expand Down

0 comments on commit cff41e0

Please sign in to comment.