From c1cc1a3ad9352a00feda1817d21ff487a742e7d4 Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Mon, 21 Nov 2022 01:12:20 +0100 Subject: [PATCH] refactoring fixes --- src/components/Author/Card.tsx | 5 ++++- src/pages/author/[slug]/index.astro | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Author/Card.tsx b/src/components/Author/Card.tsx index 7372749b..feb02cb4 100644 --- a/src/components/Author/Card.tsx +++ b/src/components/Author/Card.tsx @@ -31,7 +31,10 @@ export const AuthorCard = (props: AuthorCardProps) => { () => session()?.news?.authors?.some((u) => u === props.author.slug) || false ) const canFollow = createMemo(() => !props.hideFollow && session()?.user?.slug !== props.author.slug) - const bio = () => props.caption || props.author.bio || t('Our regular contributor') + const bio = createMemo(() => { + return props.caption || props.author.bio || t('Our regular contributor') + }) + const name = () => { return props.author.name === 'Дискурс' && locale() !== 'ru' ? 'Discours' diff --git a/src/pages/author/[slug]/index.astro b/src/pages/author/[slug]/index.astro index 97153431..663d893a 100644 --- a/src/pages/author/[slug]/index.astro +++ b/src/pages/author/[slug]/index.astro @@ -7,7 +7,7 @@ import { PRERENDERED_ARTICLES_COUNT } from '../../../components/Views/Author' const slug = Astro.params.slug.toString() const shouts = await apiClient.getShouts({ filters: { author: slug }, limit: PRERENDERED_ARTICLES_COUNT }) -const author = await apiClient.getAuthorsBy({ by: { slug } }) +const author = await apiClient.getAuthor({ slug }) const { pathname, search } = Astro.url initRouter(pathname, search)