-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added query for info-banner #363
The head ref may contain hidden characters: "349-uzavretie-s\u00E9rie-pre-\u00FA\u010Dastn\u00EDkov-banner"
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
netestoval som, a teda neviem, ci BE uz tu funkcionalitu ma, ci sa na to len chystame... kazdopadne dake komenty
src/components/Problems/Problems.tsx
Outdated
@@ -56,6 +50,14 @@ export const Problems: FC = () => { | |||
queryFn: () => axios.get<SeriesWithProblems>(`/api/competition/series/${id.seriesId}`), | |||
enabled: id.seriesId !== -1, | |||
}) | |||
|
|||
const {data: bannerMessage, isLoading: isBannerLoading} = useQuery({ | |||
queryKey: [id.seriesId], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queryKey by mal matchovat API route segmenty - nemame to nijak automatizovane, no je to globalny kluc react-query, pod ktorym cachuje response, tak cely kluc by mal odrazat, o ake data ide. tu teda asi ['cms', 'info-banner', id.seriesId]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixol som
src/components/Problems/Problems.tsx
Outdated
|
||
const {data: bannerMessage, isLoading: isBannerLoading} = useQuery({ | ||
queryKey: [id.seriesId], | ||
queryFn: () => axios.get(`/api/cms/info-banner/?series=${id.seriesId}`), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
axios.get
explicitne typujeme, pozri ako je to inde... ked info banner typ nemame generovany z BE (ktory mozno este ani nie je? kedze toto je otvorene ZdruzenieSTROM/webstrom-backend#376), tak pridat manualne do types/api/cms.ts
.. ale nejaky InfoBanner
type tam vidim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doplnil som typ
|
||
const {bannerMessages} = BannerContainer.useContainer() | ||
const divider = ' - ' | ||
if (bannerMessages === undefined || bannerMessages.length === 0) return <></> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
absolutny nitpick: ako prazdny element zvyknem vracat null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Som ho zatial necha zobrazovat kym sa nedohodneme finalne či tam bude alebo nie ... Ak by nebol aj tak treba asi vratit nejaky placeholder aby sa neposúval obsah
No description provided.