[DEV-3677] Refactor API data model and standardise property names#2170
Open
Sebastiano-Bertolin wants to merge 9 commits intoDEV-3238-strapi-5-feature-branchfrom
Open
[DEV-3677] Refactor API data model and standardise property names#2170Sebastiano-Bertolin wants to merge 9 commits intoDEV-3238-strapi-5-feature-branchfrom
Sebastiano-Bertolin wants to merge 9 commits intoDEV-3238-strapi-5-feature-branchfrom
Conversation
🦋 Changeset detectedLatest commit: b6f4fe3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
6 tasks
…tentUrls for improved clarity and maintainability
Contributor
|
This PR exceeds the recommended size of 800 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
apps/nextjs-website/src/app/[locale]/[productSlug]/api/[apiDataSlug]/page.tsx
Show resolved
Hide resolved
MarcoPonchia
requested changes
Mar 25, 2026
MarcoPonchia
requested changes
Mar 25, 2026
Collaborator
MarcoPonchia
left a comment
There was a problem hiding this comment.
I add some comment
Co-authored-by: Marco Ponchia <ponchia.marco1994@gmail.com>
Contributor
Branch is not up to date with base branch@Sebastiano-Bertolin it seems this Pull Request is not updated with base branch. |
Contributor
Jira Pull Request LinkThis Pull Request refers to the following Jira issue DEV-3677 |
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.
This pull request refactors how API Data and API Data List pages fetch and handle their data in the Next.js website. The main change is switching from legacy functions to new repository-based abstractions (
ApiDataListRepositoryandApiDataListPagesRepository), which centralize data fetching and transformation logic. This improves code maintainability, testability, and clarity. Additionally, related types and tests have been updated to match the new data flow.List of Changes
Repository abstraction and data fetching:
ApiDataListRepositoryandApiDataListPagesRepositoryto encapsulate fetching and transforming API Data and API Data List pages, replacing direct calls to legacy functions. (apps/nextjs-website/src/lib/apiDataList/index.ts,apps/nextjs-website/src/lib/apiDataListPages/index.ts)fetchApiDataList) to handle Strapi API requests for API Data, with improved population of related entities. (apps/nextjs-website/src/lib/apiDataList/fetcher.ts)Migration to new repository usage:
apps/nextjs-website/src/app/[locale]/[productSlug]/api/[apiDataSlug]/page.tsx,apps/nextjs-website/src/app/[locale]/[productSlug]/api/page.tsx) ([1], [2], [3], [4], [5], [6])Cleanup and removal of legacy code:
getApiData,getApiDataListPages) and their usages from theapi.tsfile, consolidating all API Data fetching through repositories. (apps/nextjs-website/src/lib/api.ts) [1] [2] [3]Type and prop updates:
BaseApiDataList,ApiDataList) instead of legacy Strapi types, ensuring consistency with the new repositories. (apps/nextjs-website/src/components/templates/ApiDataListTemplate/ApiDataListTemplate.tsx) [1] [2]Test migration and improvements:
mapApiDataList) for API Data List, replacing legacy test functions and updating test cases for edge scenarios. (apps/nextjs-website/src/lib/apiDataList/__tests__/mapper.test.ts) [1] [2] [3] [4] [5] [6] [7] [8] [9]Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: