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

feat/news-demo - Issue #7 #11

Closed
wants to merge 4 commits into from
Closed

feat/news-demo - Issue #7 #11

wants to merge 4 commits into from

Conversation

zeolsem
Copy link
Member

@zeolsem zeolsem commented Nov 23, 2024

Dodałem podstronkę zaciągającą i prowizorycznie wyświetlającą newsy z bazy.

Jesli chodzi o zmiany w types.ts i Navbar.tsx to głównie Prettier.

@zeolsem zeolsem requested a review from Octopus4344 November 23, 2024 22:32
Octopus4344
Octopus4344 previously approved these changes Nov 25, 2024
Copy link
Collaborator

@Octopus4344 Octopus4344 left a comment

Choose a reason for hiding this comment

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

Wszystko wyglada raczej git, drobne jakies rzeczy tylko

src/lib/types.ts Outdated
export interface NewsProps {
id: number;
name: string;
date_created: Date;
Copy link
Collaborator

Choose a reason for hiding this comment

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

API zwraca tu stringa, więc trzeba na to uwazac, w miare bezpiecznie moze byc jakos tak

Suggested change
date_created: Date;
date_created: Date | string;

albo bezpieczniej

Suggested change
date_created: Date;
date_created: string;
dateTime_created: Date;

Copy link
Collaborator

Choose a reason for hiding this comment

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

W przyszlosci trzeba bedzie pewnie pomyslec o jakiejs sensownej obsludze bledow i paginacji, poki co mysle ze git

Comment on lines 12 to 14
const newsSortedByDate = news.sort(
(a, b) => b.date_created.getTime() - a.date_created.getTime()
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Poki co wystarczy odwrocic liste, bo dane sa autonumerowanych indexach, przez zrobi sie liniowa zlozonosc

Suggested change
const newsSortedByDate = news.sort(
(a, b) => b.date_created.getTime() - a.date_created.getTime()
);
const newsSortedByDate = news.reverse();

@zeolsem
Copy link
Member Author

zeolsem commented Dec 1, 2024

@Octopus4344 poprawiłem te rzeczy i dodalem basic paginację.

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.

2 participants