From c2035b801af2f1921427df86af80821bc872e1e7 Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 17 Feb 2024 21:57:02 +0300 Subject: [PATCH] update-fixxd --- src/components/Feed/ArticleCard/ArticleCard.tsx | 4 ++-- src/context/editor.tsx | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/Feed/ArticleCard/ArticleCard.tsx b/src/components/Feed/ArticleCard/ArticleCard.tsx index 92ecb5f1..760ce1e3 100644 --- a/src/components/Feed/ArticleCard/ArticleCard.tsx +++ b/src/components/Feed/ArticleCard/ArticleCard.tsx @@ -23,7 +23,7 @@ import stylesHeader from '../../Nav/Header/Header.module.scss' import styles from './ArticleCard.module.scss' export type ArticleCardProps = { -// TODO: refactor this, please + // TODO: refactor this, please settings?: { noicon?: boolean noimage?: boolean @@ -192,7 +192,7 @@ export const ArticleCard = (props: ArticleCardProps) => {
-{/**/} + {/**/}
diff --git a/src/context/editor.tsx b/src/context/editor.tsx index da11f919..40f21d2d 100644 --- a/src/context/editor.tsx +++ b/src/context/editor.tsx @@ -229,10 +229,15 @@ export const EditorProvider = (props: { children: JSX.Element }) => { const publishShoutById = async (shout_id: number) => { try { - const newShout = await apiClient.updateArticle({ + const { shout: newShout, error } = await apiClient.updateArticle({ shout_id, publish: true, }) + if (error) { + console.error(error) + snackbar?.showSnackbar({ type: 'error', body: error }) + return + } if (newShout) { addArticles([newShout]) openPage(router, 'feed')