Skip to content

Commit

Permalink
fix(ci/cd): Set window.location.origin to call the server
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed May 16, 2024
1 parent b57427a commit ba7fa10
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/send-mail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function EmailSender({ contribution }: { contribution: Contribution }) {
const data = {
comment: response,
};
const responsePatch = await fetch(`api/${basePath}/${contribution._id}`, {
const responsePatch = await fetch(`${window.location.origin}/api/${basePath}/${contribution._id}`, {
method: "PATCH",
headers: postHeaders,
body: JSON.stringify(data),
Expand Down
2 changes: 1 addition & 1 deletion src/api/utils/buildURL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,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 `${window.location.origin}/api/${baseUrl}?${sorted}&page=${page}&max_results=20${whereQuery}`;
};
2 changes: 1 addition & 1 deletion src/components/edit-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const EditModal: React.FC<EditModalProps> = ({ isOpen, data, onClose }) => {

const handleSubmit = async () => {
try {
const response = await fetch(`api/${basePath}/${data._id}`, {
const response = await fetch(`${window.location.origin}/api/${basePath}/${data._id}`, {
method: "PATCH",
headers: postHeaders,
body: JSON.stringify({
Expand Down

0 comments on commit ba7fa10

Please sign in to comment.