mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
Fix share url.
This commit is contained in:
parent
9d6bb64c3d
commit
397796cfff
1 changed files with 10 additions and 6 deletions
|
|
@ -40,10 +40,7 @@ export function ShareEditForm({
|
||||||
const isEditing = !!shareId;
|
const isEditing = !!shareId;
|
||||||
|
|
||||||
const getUrl = (slug: string) => {
|
const getUrl = (slug: string) => {
|
||||||
if (cloudMode) {
|
return `${cloudMode ? process.env.cloudUrl : window?.location.origin}${process.env.basePath || ''}/share/${slug}`;
|
||||||
return `${process.env.cloudUrl}/share/${slug}`;
|
|
||||||
}
|
|
||||||
return `${window?.location.origin}${process.env.basePath || ''}/share/${slug}`;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -74,9 +71,16 @@ export function ShareEditForm({
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (isEditing) {
|
if (isEditing) {
|
||||||
await post(`/share/id/${shareId}`, { name: data.name, slug: share.slug, parameters });
|
await post(`/share/id/${shareId}`, {
|
||||||
|
name: data.name,
|
||||||
|
slug: share.slug,
|
||||||
|
parameters,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
await post(`/websites/${websiteId}/shares`, { name: data.name, parameters });
|
await post(`/websites/${websiteId}/shares`, {
|
||||||
|
name: data.name,
|
||||||
|
parameters,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
touch('shares');
|
touch('shares');
|
||||||
onSave?.();
|
onSave?.();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue