mirror of
https://github.com/strapi/strapi.git
synced 2025-08-08 08:46:42 +00:00
update ConfigurationsProvider with new logo
This commit is contained in:
parent
681f095455
commit
c2605de89a
@ -12,6 +12,7 @@ import {
|
||||
request,
|
||||
useNotification,
|
||||
TrackingContext,
|
||||
prefixFileUrlWithBackendUrl,
|
||||
} from '@strapi/helper-plugin';
|
||||
import { SkipToContent } from '@strapi/design-system/Main';
|
||||
import { useIntl } from 'react-intl';
|
||||
@ -71,7 +72,7 @@ function App() {
|
||||
data: { hasAdmin, uuid, menuLogo },
|
||||
} = await request('/admin/init', { method: 'GET' });
|
||||
|
||||
setCustomLogo(menuLogo, 'menu');
|
||||
setCustomLogo(prefixFileUrlWithBackendUrl(menuLogo), 'menu');
|
||||
|
||||
if (uuid) {
|
||||
try {
|
||||
|
@ -17,6 +17,7 @@ import { Link } from '@strapi/design-system/Link';
|
||||
import { Button } from '@strapi/design-system/Button';
|
||||
import ExternalLink from '@strapi/icons/ExternalLink';
|
||||
import Check from '@strapi/icons/Check';
|
||||
import { useConfigurations } from '../../../../hooks';
|
||||
import Form from './components/Form';
|
||||
import { fetchProjectSettings, updateProjectSettings } from './utils/api';
|
||||
import { getFormData } from './utils/getFormData';
|
||||
@ -30,6 +31,10 @@ const ApplicationInfosPage = () => {
|
||||
useFocusWhenNavigate();
|
||||
const appInfos = useAppInfos();
|
||||
const { shouldUpdateStrapi, latestStrapiReleaseTag, strapiVersion } = appInfos;
|
||||
const {
|
||||
setCustomLogo,
|
||||
logos: { menu },
|
||||
} = useConfigurations();
|
||||
|
||||
const { data } = useQuery('project-settings', fetchProjectSettings);
|
||||
|
||||
@ -38,8 +43,9 @@ const ApplicationInfosPage = () => {
|
||||
: 'app.components.UpgradePlanModal.text-ee';
|
||||
|
||||
const submitMutation = useMutation(body => updateProjectSettings(body), {
|
||||
onSuccess: async () => {
|
||||
onSuccess: async ({ menuLogo }) => {
|
||||
await queryClient.invalidateQueries('project-settings', { refetchActive: true });
|
||||
setCustomLogo(menuLogo?.url || menu.default, 'menu');
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -8,7 +8,9 @@ const fetchProjectSettings = async () => {
|
||||
};
|
||||
|
||||
const updateProjectSettings = async body => {
|
||||
await axiosInstance.post('/admin/project-settings', body);
|
||||
const { data } = await axiosInstance.post('/admin/project-settings', body);
|
||||
|
||||
return prefixAllUrls(data);
|
||||
};
|
||||
|
||||
export { fetchProjectSettings, updateProjectSettings };
|
||||
|
Loading…
x
Reference in New Issue
Block a user