Skip to content

Commit

Permalink
frontend: relative backend requests (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyralemos authored Feb 25, 2025
1 parent ecd073c commit ced4337
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 48 deletions.
4 changes: 2 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function App() {
<div className="container-fluid text-center logo">
<a className="navbar-brand" href="/">
<img
src="/++resource++plone-logo.svg"
src="./++resource++plone-logo.svg"
width="215"
height="56"
alt="Plone logo"
Expand Down Expand Up @@ -94,7 +94,7 @@ function App() {
<div className="logo">
<a title="Site" href="/">
<img
src="/++resource++plone-logo.svg"
src="./++resource++plone-logo.svg"
alt="Plone Site"
title="Plone Site"
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/LoginModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const LoginModal = ({
const [extraErrors, setExtraErrors] = useState({});

async function onSubmit(value: any) {
const response = await fetch('/@login', {
const response = await fetch('./@login', {
method: 'POST',
headers: {
Accept: 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/SitesInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const SitesInfo = () => {
const [cameFrom, setCameFrom] = useState('');

const checkBasicAuth = async () => {
const response = await fetch('/@@ploneAddSite', {
const response = await fetch('./@@ploneAddSite', {
method: 'GET',
});
if (response.status === 401) {
Expand All @@ -26,7 +26,7 @@ const SitesInfo = () => {

const handleClick = async (can_manage: boolean, name: string) => {
const href = import.meta.env.PROD
? `/@@ploneAddSite?distribution=${name}`
? `./@@ploneAddSite?distribution=${name}`
: `/?distribution=${name}`;
if (can_manage) {
// Redirect
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type SitesEndpointDistributionDetail = {
};

const getDistributions = async (): Promise<SitesEndpoint> => {
const response = await axios.get('/@sites');
const response = await axios.get('./@sites');
const data = await response.data;
return data;
};
Expand All @@ -55,7 +55,7 @@ export const getDistributionsQuery = () => ({
const getDistribution = async (
name: string,
): Promise<SitesEndpointDistributionDetail> => {
const response = await axios.get(`/@sites/${name}`);
const response = await axios.get(`./@sites/${name}`);
const data = await response.data;
return data;
};
Expand Down Expand Up @@ -100,7 +100,7 @@ export const getDistributionQuery = (name: string) => ({
});

export const addSite = async (body: object): Promise<Site> => {
const response = await axios.post(`/@sites/`, body);
const response = await axios.post(`./@sites/`, body);
const data = await response.data;
return data;
};
1 change: 1 addition & 0 deletions news/98.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
frontend: relative backend requests @lyralemos
80 changes: 40 additions & 40 deletions src/plone/distribution/browser/static/plone-overview.min.js

Large diffs are not rendered by default.

0 comments on commit ced4337

Please sign in to comment.