feat: role system
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Box, Tab, Tabs } from "@mui/material";
|
||||
import {
|
||||
articlesStore,
|
||||
authStore,
|
||||
cityStore,
|
||||
createSightStore,
|
||||
languageStore,
|
||||
@@ -40,7 +41,14 @@ export const CreateSightPage = observer(() => {
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
await getCities("ru");
|
||||
if (!authStore.me) {
|
||||
await authStore.getMeAction().catch(() => undefined);
|
||||
}
|
||||
if (authStore.canRead("cities")) {
|
||||
await getCities("ru");
|
||||
} else {
|
||||
await authStore.fetchMeCities().catch(() => undefined);
|
||||
}
|
||||
await getArticles(languageStore.language);
|
||||
};
|
||||
fetchData();
|
||||
|
||||
Reference in New Issue
Block a user