feat: role system

This commit is contained in:
2026-03-18 20:11:07 +03:00
parent 73070fe233
commit c3127b8d47
47 changed files with 2425 additions and 768 deletions

View File

@@ -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();