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

@@ -5,6 +5,7 @@ import { useEffect, useState } from "react";
import { observer } from "mobx-react-lite";
import {
articlesStore,
authStore,
cityStore,
editSightStore,
LoadingSpinner,
@@ -41,7 +42,14 @@ export const EditSightPage = observer(() => {
if (id) {
setIsLoadingData(true);
try {
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 getSightInfo(+id, "ru");
await getSightInfo(+id, "en");
await getSightInfo(+id, "zh");