mirror of
https://github.com/umami-software/umami.git
synced 2026-02-18 19:45:35 +01:00
Created admin API endpoints.
This commit is contained in:
parent
e1c65cdf2a
commit
442ad61779
8 changed files with 133 additions and 49 deletions
|
|
@ -17,7 +17,7 @@ export function WebsiteSettings({ websiteId, openExternal = false }) {
|
|||
const { formatMessage, labels, messages } = useMessages();
|
||||
const { get, useQuery } = useApi();
|
||||
const { showToast } = useToasts();
|
||||
const { websitesUrl, settingsUrl } = useContext(SettingsContext);
|
||||
const { websitesUrl, websitesPath, settingsPath } = useContext(SettingsContext);
|
||||
const { data, isLoading } = useQuery({
|
||||
queryKey: ['website', websiteId],
|
||||
queryFn: () => get(`${websitesUrl}/${websiteId}`),
|
||||
|
|
@ -38,7 +38,7 @@ export function WebsiteSettings({ websiteId, openExternal = false }) {
|
|||
|
||||
const handleReset = async (value: string) => {
|
||||
if (value === 'delete') {
|
||||
router.push(settingsUrl);
|
||||
router.push(settingsPath);
|
||||
} else if (value === 'reset') {
|
||||
showSuccess();
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ export function WebsiteSettings({ websiteId, openExternal = false }) {
|
|||
return (
|
||||
<>
|
||||
<PageHeader title={values?.name}>
|
||||
<Link href={`${websitesUrl}/${websiteId}`} target={openExternal ? '_blank' : null}>
|
||||
<Link href={`${websitesPath}/${websiteId}`} target={openExternal ? '_blank' : null}>
|
||||
<Button variant="primary">
|
||||
<Icon>
|
||||
<Icons.External />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue