Skip to content
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

Merged
merged 6 commits into from
May 18, 2024

Conversation

vgeffer
Copy link
Contributor

@vgeffer vgeffer commented Apr 14, 2024

No description provided.

@vgeffer vgeffer linked an issue Apr 14, 2024 that may be closed by this pull request
Copy link
Collaborator

@rtrembecky rtrembecky left a 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

@@ -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],
Copy link
Collaborator

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]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixol som


const {data: bannerMessage, isLoading: isBannerLoading} = useQuery({
queryKey: [id.seriesId],
queryFn: () => axios.get(`/api/cms/info-banner/?series=${id.seriesId}`),
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doplnil som typ

@kovacspe kovacspe requested a review from Matushl May 18, 2024 12:35

const {bannerMessages} = BannerContainer.useContainer()
const divider = ' - '
if (bannerMessages === undefined || bannerMessages.length === 0) return <></>
Copy link
Collaborator

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

Copy link
Collaborator

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

@kovacspe kovacspe merged commit 5dbf068 into master May 18, 2024
1 check passed
@kovacspe kovacspe deleted the 349-uzavretie-série-pre-účastníkov-banner branch May 18, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uzavretie série pre účastníkov - banner
3 participants