Merged
Conversation
Feature Feature
There was a problem hiding this comment.
Pull Request Overview
This PR targets the "main/production" branch and updates both the contacts seeder and the view data action to improve resource references and performance. Key changes include updating the contact image URL in the seeder and refactoring the contact-fetching logic in the ViewDataAction to cache published contacts and filter them in-memory.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| database/seeders/Paperflakes/ContactsTableSeeder.php | Updated the contact image URL to reference a new asset version. |
| app/Actions/ViewDataAction.php | Optimized the contact query by caching the published contacts and refactoring the filtering logic. |
Comments suppressed due to low confidence (1)
database/seeders/Paperflakes/ContactsTableSeeder.php:146
- Verify that the updated image URL aligns with the intended asset and naming conventions for consistency with other contact entries.
'image' => 'https://res.cloudinary.com/codebar/image/upload/w_400,h_400,f_auto,q_auto/www-paperflakes-ch/people/drg_e_background_removal_f_png.webp',
Comment on lines
+62
to
72
| ->filter(function ($contact) use ($section) { | ||
| $sections = $contact->sections ?? []; | ||
|
|
||
| return array_key_exists($section, $sections); | ||
| }) | ||
| ->map(fn ($contact) => ContactDTO::fromModel($contact, $section, $locale)); | ||
|
|
||
| return [$section => $contacts]; | ||
| return [$section => $contacts->values()]; | ||
| })->all(); | ||
| }); | ||
| } |
There was a problem hiding this comment.
[nitpick] Consider extracting the anonymous filter function into a separate, well-named method to improve clarity and potential reusability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.