-
Notifications
You must be signed in to change notification settings - Fork 14
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
DDFHER-101- Allow retrieval of opening hours for multiple branches #1659
Merged
kasperbirch1
merged 4 commits into
develop
from
DDFHER-101-retrieval-of-opening-hours-for-multiple-libraries-in-api
Oct 29, 2024
Merged
DDFHER-101- Allow retrieval of opening hours for multiple branches #1659
kasperbirch1
merged 4 commits into
develop
from
DDFHER-101-retrieval-of-opening-hours-for-multiple-libraries-in-api
Oct 29, 2024
Conversation
This file contains 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
kasperbirch1
force-pushed
the
DDFHER-101-retrieval-of-opening-hours-for-multiple-libraries-in-api
branch
2 times, most recently
from
October 21, 2024 12:51
c2ca064
to
76dec5c
Compare
kasperg
requested changes
Oct 22, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the effort but I think this needs another round on multiple levels.
web/modules/custom/dpl_opening_hours/src/Plugin/rest/resource/v1/OpeningHoursResource.php
Outdated
Show resolved
Hide resolved
web/modules/custom/dpl_opening_hours/src/Plugin/rest/resource/v1/OpeningHoursResource.php
Outdated
Show resolved
Hide resolved
web/modules/custom/dpl_opening_hours/src/Model/OpeningHoursRepository.php
Outdated
Show resolved
Hide resolved
web/modules/custom/dpl_opening_hours/src/Plugin/rest/resource/v1/OpeningHoursResource.php
Outdated
Show resolved
Hide resolved
web/modules/custom/dpl_opening_hours/src/Plugin/rest/resource/v1/OpeningHoursResource.php
Outdated
Show resolved
Hide resolved
web/modules/custom/dpl_opening_hours/src/Plugin/rest/resource/v1/OpeningHoursResource.php
Outdated
Show resolved
Hide resolved
kasperbirch1
force-pushed
the
DDFHER-101-retrieval-of-opening-hours-for-multiple-libraries-in-api
branch
from
October 23, 2024 11:47
76dec5c
to
4a70427
Compare
Updated the `OpeningHoursRepository::loadMultiple` method to accept an array of branch IDs, enabling queries for multiple branches using the `IN` operator. In OpeningHoursResource, the `branch_id` / `nid` parameter now accepts a single ID or a comma-separated list of IDs. These changes maintain backward compatibility while enhancing the `redia_legacy` API to support retrieval of opening hours for multiple branches in a single request.
kasperbirch1
force-pushed
the
DDFHER-101-retrieval-of-opening-hours-for-multiple-libraries-in-api
branch
from
October 23, 2024 11:54
4a70427
to
066ae5f
Compare
kasperg
reviewed
Oct 24, 2024
web/modules/custom/dpl_opening_hours/src/Plugin/rest/resource/v1/OpeningHoursResource.php
Outdated
Show resolved
Hide resolved
Since the specification permits only a single integer for branch_id, we should continue using getInt. We’ll wrap it in an array with getInt('branch_id') as the sole item.
`PREG_NO_ERROR` is not a valid flag for `preg_split()`, and the intended behavior is to exclude empty strings from the resulting array.
Return an empty array if getInt('branch_id') is null. ```` Parameter #1 $branchIds of method Drupal\dpl_opening_hours\Model\OpeningHoursRepository::loadMultiple() expects array<int>, array<int, int|null> given. ```
kasperg
approved these changes
Oct 28, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
kasperbirch1
deleted the
DDFHER-101-retrieval-of-opening-hours-for-multiple-libraries-in-api
branch
October 29, 2024 09:23
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.
Link to issue
https://reload.atlassian.net/browse/DDFHER-101
Description
This pull request enhances the opening hours API (redia_legacy) by enabling clients to retrieve opening hours for multiple branches within a single request. Previously, the API allowed retrieval for only one branch at a time.
Test
Redia API (supports multiple branches):
Cms API: