Skip to content

Salem B.#4

Open
Barboud wants to merge 5 commits into
HackYourAssignment:mainfrom
Barboud:main
Open

Salem B.#4
Barboud wants to merge 5 commits into
HackYourAssignment:mainfrom
Barboud:main

Conversation

@Barboud

@Barboud Barboud commented Jul 1, 2026

Copy link
Copy Markdown

No description provided.

@dilero

dilero commented Jul 7, 2026

Copy link
Copy Markdown

PR descriptions are very useful tools for reviewers. Also very good reference for other developers and AI when you check changes in the project history. I recommend you to write the description.

@Configuration
public class B2Config {

@Value("${b2.endpoint}") private String endpoint;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice that you use these values as config.

public List<Product> getAllProducts() {
return jdbcClient
.sql("SELECT id, title, price, category, image_url FROM products")
.sql("SELECT * FROM products")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SELECT * grabs every column, which is problematic because:

Wastes resources — fetches data you don't need
Brittle — if columns change later, your code silently breaks
Hard to read — no one knows what data you actually need

Fix: name only the columns you use → SELECT id, name, price FROM products
Fine for quick debugging, not for production code.

return ProductResponse.from(updatedProduct);

} catch (Exception e) {
throw new RuntimeException("Failed to upload product image", e);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

would be nice to log the exception here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks @dilero, for your review and time.
Could you explain to me how I can log the exception here, to ensure next time I do it in the proper way?

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