fix: Page list not refreshing and dialog styling
- Fix api response handling in pages query (api returns JSON directly) - Fix page-structure query response handling - Add theme class copying to dialog portal for proper CSS variable inheritance - Portal container now syncs with document theme (light/dark)
This commit is contained in:
@@ -51,8 +51,9 @@ export default function AppearancePages() {
|
||||
const { data: pages = [], isLoading: pagesLoading } = useQuery<PageItem[]>({
|
||||
queryKey: ['pages'],
|
||||
queryFn: async () => {
|
||||
// api.get returns JSON directly (not wrapped in { data: ... })
|
||||
const response = await api.get('/pages');
|
||||
return response.data;
|
||||
return response; // Return response directly
|
||||
},
|
||||
});
|
||||
|
||||
@@ -64,8 +65,9 @@ export default function AppearancePages() {
|
||||
const endpoint = selectedPage.type === 'page'
|
||||
? `/pages/${selectedPage.slug}`
|
||||
: `/templates/${selectedPage.cpt}`;
|
||||
// api.get returns JSON directly
|
||||
const response = await api.get(endpoint);
|
||||
return response.data;
|
||||
return response; // Return response directly
|
||||
},
|
||||
enabled: !!selectedPage,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user