fix: Update map with tables fixes
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
// @shared/stores/createSightStore.ts
|
||||
import { Language, authInstance, languageInstance, mediaStore } from "@shared";
|
||||
import {
|
||||
articlesStore,
|
||||
Language,
|
||||
authInstance,
|
||||
languageInstance,
|
||||
mediaStore,
|
||||
} from "@shared";
|
||||
import { makeAutoObservable, runInAction } from "mobx";
|
||||
|
||||
type MediaItem = {
|
||||
@@ -162,6 +168,8 @@ class CreateSightStore {
|
||||
media: mediaData,
|
||||
});
|
||||
});
|
||||
|
||||
return articleId; // Return the linked article ID
|
||||
} catch (error) {
|
||||
console.error("Error linking existing right article:", error);
|
||||
throw error;
|
||||
@@ -315,7 +323,18 @@ class CreateSightStore {
|
||||
deleteLeftArticle = async (articleId: number) => {
|
||||
/* ... your existing logic ... */
|
||||
await authInstance.delete(`/article/${articleId}`);
|
||||
// articlesStore.getArticles(languageStore.language); // If still needed
|
||||
// articlesStore.getArticles(languageStore.language); // If still neede
|
||||
runInAction(() => {
|
||||
articlesStore.articles.ru = articlesStore.articles.ru.filter(
|
||||
(article) => article.id !== articleId
|
||||
);
|
||||
articlesStore.articles.en = articlesStore.articles.en.filter(
|
||||
(article) => article.id !== articleId
|
||||
);
|
||||
articlesStore.articles.zh = articlesStore.articles.zh.filter(
|
||||
(article) => article.id !== articleId
|
||||
);
|
||||
});
|
||||
this.unlinkLeftArticle();
|
||||
};
|
||||
|
||||
@@ -352,6 +371,25 @@ class CreateSightStore {
|
||||
body: "填写内容",
|
||||
media: [],
|
||||
};
|
||||
|
||||
articlesStore.articles.ru.push({
|
||||
id: newLeftArticleId,
|
||||
heading: "Новая левая статья",
|
||||
body: "Заполните контентом",
|
||||
service_name: "Новая левая статья",
|
||||
});
|
||||
articlesStore.articles.en.push({
|
||||
id: newLeftArticleId,
|
||||
heading: "New Left Article",
|
||||
body: "Fill with content",
|
||||
service_name: "New Left Article",
|
||||
});
|
||||
articlesStore.articles.zh.push({
|
||||
id: newLeftArticleId,
|
||||
heading: "新的左侧文章",
|
||||
body: "填写内容",
|
||||
service_name: "新的左侧文章",
|
||||
});
|
||||
});
|
||||
return newLeftArticleId;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user