Update media select in EditSightPage and CreateSightPage
This commit is contained in:
@@ -88,7 +88,8 @@ class EditSightStore {
|
||||
|
||||
const response = await authInstance.get(`/sight/${id}`);
|
||||
const data = response.data;
|
||||
if (data.left_article != 0) {
|
||||
|
||||
if (data.left_article != 0 && data.left_article != null) {
|
||||
await this.getLeftArticle(data.left_article);
|
||||
}
|
||||
|
||||
@@ -260,7 +261,10 @@ class EditSightStore {
|
||||
});
|
||||
|
||||
this.sight.common.left_article = createdLeftArticleId;
|
||||
} else if (this.sight.common.left_article != 0) {
|
||||
} else if (
|
||||
this.sight.common.left_article != 0 &&
|
||||
this.sight.common.left_article != null
|
||||
) {
|
||||
await languageInstance("ru").patch(
|
||||
`/article/${this.sight.common.left_article}`,
|
||||
{
|
||||
@@ -306,6 +310,9 @@ class EditSightStore {
|
||||
|
||||
for (const language of ["ru", "en", "zh"] as Language[]) {
|
||||
for (const article of this.sight[language].right) {
|
||||
if (article.id == 0 || article.id == null) {
|
||||
continue;
|
||||
}
|
||||
await languageInstance(language).patch(`/article/${article.id}`, {
|
||||
heading: article.heading,
|
||||
body: article.body,
|
||||
|
||||
Reference in New Issue
Block a user