feat: cache delete + empty snapshot + route page

This commit is contained in:
2026-04-28 03:50:29 +03:00
parent 248eea6f85
commit 60c6840db4
21 changed files with 770 additions and 361 deletions

View File

@@ -20,6 +20,7 @@ import {
} from "@widgets";
import { Trash2, ImagePlus, Unlink, Plus, Save, Search } from "lucide-react";
import { useState, useCallback } from "react";
import { useNavigate } from "react-router-dom";
import { observer } from "mobx-react-lite";
import { toast } from "react-toastify";
@@ -41,6 +42,7 @@ export const CreateLeftTab = observer(
uploadMediaOpen,
setUploadMediaOpen,
} = editSightStore;
const navigate = useNavigate();
const { language } = languageStore;
const token = localStorage.getItem("token");
@@ -449,8 +451,9 @@ export const CreateLeftTab = observer(
startIcon={<Save color="white" size={18} />}
onClick={async () => {
try {
await createSight(language);
const newSightId = await createSight(language);
toast.success("Страница создана");
navigate(`/sight/${newSightId}/edit`);
} catch (error) {
console.error(error);
}