Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: relative backend requests #111

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading