Skip to content

Conversation

@Mikadv
Copy link
Contributor

@Mikadv Mikadv commented Aug 6, 2025

To be able to demonstrate better external API usage introduced two new API service:

  • added getPost
  • added getComments
  • removed: getMessage

created a Posts section in the Welcome page with comments where we render these external data.

This is how that section looks like after this change:
Screenshot 2025-10-03 at 13 48 49

@Mikadv Mikadv requested a review from rodet as a code owner August 6, 2025 20:31
Mikadv and others added 8 commits October 3, 2025 13:30
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…stency

also removed unnecessary console.log

Resolves: no-ticket
Signed-off-by: [Balint Lendvai] <lendvai.balint@gmail.com>
… environments in message API functions

Resolves: no-ticket
Signed-off-by: [Balint Lendvai] <lendvai.balint@gmail.com>
…lanation

- Updated layout to improve readability and added a detailed explanation of the data fetching process.
- fixed posts responsive behaviour in mobile size
- Removed unnecessary styles from the dynamic message section paragraphs.

Resolves: no-ticket
Signed-off-by: [Balint Lendvai] <lendvai.balint@gmail.com>
- Handled review comments
- Changed error handling to set comments state correctly on failure.
- Enhanced layout by introducing Stack components for better spacing and readability.
- Updated paragraph elements for post body and comments for consistency.

Resolves: no-ticket
Signed-off-by: [Balint Lendvai] <lendvai.balint@gmail.com>
@bogy0 bogy0 force-pushed the feat/network-query-examples branch from 2b321ae to 9be2fbc Compare October 3, 2025 11:35
@bogy0 bogy0 changed the title Feat/network query examples feat: add network query example to fetch posts and comments Oct 3, 2025
@bogy0 bogy0 requested a review from lee-chase October 3, 2025 12:28
Copy link
Member

@lee-chase lee-chase left a comment

Choose a reason for hiding this comment

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

Looks good to me, made a couple of small changes to pass linter and remove layer level which was not needed.

try {
const response = await fetch(
// TODO: replace with actual endpoint URL
`https://jsonplaceholder.typicode.com/posts/${id}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should be relying on an external provider here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we can just rename this postHandlers file to something that indicates more that this is just an EXAMPLE, thats why this provider, or we can deploy our own dummy API somewhere in IBM Cloud that gives back something like this, but maybe thats overkill....

try {
// TODO: handle production and development environments
const response = await fetch(
`http://localhost:5173/api/comments?postId=${postId}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any way to remove that hardcoding here?

Copy link
Member

Choose a reason for hiding this comment

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

@rodet Environment variables, single source of truth config file or runtime detection?

Copy link
Collaborator

Choose a reason for hiding this comment

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

i like the idea to use a single source of truth config combined with nconf. This way the default value that stored in the config file can be overwritten by setting some env variables.
https://www.npmjs.com/package/nconf/

Copy link
Contributor

@rodet rodet left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @bogy0 . Let's first discuss the findings before merging this.

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.

4 participants