update-fixxd
This commit is contained in:
parent
3f7679710f
commit
c2035b801a
|
@ -23,7 +23,7 @@ import stylesHeader from '../../Nav/Header/Header.module.scss'
|
||||||
import styles from './ArticleCard.module.scss'
|
import styles from './ArticleCard.module.scss'
|
||||||
|
|
||||||
export type ArticleCardProps = {
|
export type ArticleCardProps = {
|
||||||
// TODO: refactor this, please
|
// TODO: refactor this, please
|
||||||
settings?: {
|
settings?: {
|
||||||
noicon?: boolean
|
noicon?: boolean
|
||||||
noimage?: boolean
|
noimage?: boolean
|
||||||
|
@ -192,7 +192,7 @@ export const ArticleCard = (props: ArticleCardProps) => {
|
||||||
<div class={styles.shoutCardType}>
|
<div class={styles.shoutCardType}>
|
||||||
<a href={`/expo/${props.article.layout}`}>
|
<a href={`/expo/${props.article.layout}`}>
|
||||||
<Icon name={props.article.layout} class={styles.icon} />
|
<Icon name={props.article.layout} class={styles.icon} />
|
||||||
{/*<Icon name={`${layout}-hover`} class={clsx(styles.icon, styles.iconHover)} />*/}
|
{/*<Icon name={`${layout}-hover`} class={clsx(styles.icon, styles.iconHover)} />*/}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
|
@ -229,10 +229,15 @@ export const EditorProvider = (props: { children: JSX.Element }) => {
|
||||||
|
|
||||||
const publishShoutById = async (shout_id: number) => {
|
const publishShoutById = async (shout_id: number) => {
|
||||||
try {
|
try {
|
||||||
const newShout = await apiClient.updateArticle({
|
const { shout: newShout, error } = await apiClient.updateArticle({
|
||||||
shout_id,
|
shout_id,
|
||||||
publish: true,
|
publish: true,
|
||||||
})
|
})
|
||||||
|
if (error) {
|
||||||
|
console.error(error)
|
||||||
|
snackbar?.showSnackbar({ type: 'error', body: error })
|
||||||
|
return
|
||||||
|
}
|
||||||
if (newShout) {
|
if (newShout) {
|
||||||
addArticles([newShout])
|
addArticles([newShout])
|
||||||
openPage(router, 'feed')
|
openPage(router, 'feed')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user