Fixed share url.
This commit is contained in:
@@ -51,7 +51,7 @@ export function WebsiteSettings({ websiteId, openExternal = false }) {
|
||||
}, [data]);
|
||||
|
||||
if (isLoading || !values) {
|
||||
return <Loading />;
|
||||
return <Loading position="page" />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -17,15 +17,15 @@ import SettingsContext from '../../SettingsContext';
|
||||
const generateId = () => getRandomChars(16);
|
||||
|
||||
export function ShareUrl({ websiteId, data, onSave }) {
|
||||
const ref = useRef(null);
|
||||
const { shareUrl, websitesUrl } = useContext(SettingsContext);
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const { name, shareId } = data;
|
||||
const [id, setId] = useState(shareId);
|
||||
const { post, useMutation } = useApi();
|
||||
const { mutate, error } = useMutation({
|
||||
mutationFn: (data: any) => post(`/websites/${websiteId}`, data),
|
||||
mutationFn: (data: any) => post(`${websitesUrl}/${websiteId}`, data),
|
||||
});
|
||||
const ref = useRef(null);
|
||||
const { shareUrl } = useContext(SettingsContext);
|
||||
const url = useMemo(
|
||||
() => `${shareUrl}${process.env.basePath}/share/${id}/${encodeURIComponent(name)}`,
|
||||
[id, name],
|
||||
|
||||
Reference in New Issue
Block a user