Skip to content
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

Enable to import vac as CSV #993

Merged
merged 5 commits into from
Jan 17, 2025
Merged

Enable to import vac as CSV #993

merged 5 commits into from
Jan 17, 2025

Conversation

AliKdhim87
Copy link
Contributor

@AliKdhim87 AliKdhim87 commented Jan 10, 2025

Strapi v4 does not natively support bulk creation endpoints, which can make handling large numbers of entries inefficient. While a custom controller could be implemented to handle multiple entries in a single request, this would require backend adjustments and might not be worth the effort, as this feature is only needed once. Additionally, bulk creation support may be available in Strapi v5, making this solution more temporary.

To address this, I implemented a loop that processes each entry individually while controlling concurrency with p-limit. This ensures no more than 5 requests are sent at once, preventing server overload and improving performance. By using p-limit, the system remains stable and responsive, even when processing multiple entries concurrently.

issue

Copy link

vercel bot commented Jan 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cms-frameless-io ❌ Failed (Inspect) Jan 16, 2025 4:02pm
tiptap ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2025 4:02pm

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
...trapi-admin-extensions/src/utils/processCsvFile.ts 100.00% <100.00%> (ø)
.../strapi-admin-extensions/src/utils/sanitizeHTML.ts 100.00% <100.00%> (ø)

apps/overige-objecten-api/src/utils/sanitizeHTML.ts Outdated Show resolved Hide resolved
apps/overige-objecten-api/src/server.ts Outdated Show resolved Hide resolved
apps/overige-objecten-api/src/utils/processCsvFile.ts Outdated Show resolved Hide resolved
apps/overige-objecten-api/src/utils/processCsvFile.ts Outdated Show resolved Hide resolved
apps/overige-objecten-api/src/utils/processCsvFile.ts Outdated Show resolved Hide resolved
apps/overige-objecten-api/src/utils/processCsvFile.test.ts Outdated Show resolved Hide resolved
apps/overige-objecten-api/src/controllers/import/index.ts Outdated Show resolved Hide resolved
@AliKdhim87 AliKdhim87 force-pushed the enable-to-import-vac-as-csv branch from c06cbd7 to 434a366 Compare January 14, 2025 10:30
@AliKdhim87 AliKdhim87 requested a review from Robbert January 14, 2025 10:30
@AliKdhim87 AliKdhim87 force-pushed the enable-to-import-vac-as-csv branch from 5959439 to cd0dfb4 Compare January 14, 2025 15:27
@AliKdhim87 AliKdhim87 force-pushed the enable-to-import-vac-as-csv branch from cd0dfb4 to 033875f Compare January 14, 2025 15:41
@AliKdhim87 AliKdhim87 force-pushed the enable-to-import-vac-as-csv branch from 033875f to 09a22e7 Compare January 14, 2025 15:47
@AliKdhim87 AliKdhim87 force-pushed the enable-to-import-vac-as-csv branch from 09a22e7 to b51909e Compare January 14, 2025 15:53
@AliKdhim87 AliKdhim87 self-assigned this Jan 15, 2025
Copy link
Member

@Robbert Robbert left a comment

Choose a reason for hiding this comment

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

Laatste puntje: het zou netjes zijn om een eigen openapi.yaml te hebben en te publiceren voor deze nieuwe REST API. Zie API-51

Dockerfile.dev Show resolved Hide resolved
docker-compose.pdc.prod.yml Show resolved Hide resolved
docker-compose.pdc.dev.yml Outdated Show resolved Hide resolved
apps/strapi-admin-extensions/tsconfig.json Show resolved Hide resolved
apps/strapi-admin-extensions/src/utils/envAvailability.ts Outdated Show resolved Hide resolved
apps/strapi-admin-extensions/src/server.ts Outdated Show resolved Hide resolved
@AliKdhim87 AliKdhim87 force-pushed the enable-to-import-vac-as-csv branch from b51909e to 399bb87 Compare January 16, 2025 15:59
@AliKdhim87 AliKdhim87 merged commit eb2bfcf into main Jan 17, 2025
7 of 8 checks passed
@AliKdhim87 AliKdhim87 deleted the enable-to-import-vac-as-csv branch January 17, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maak het mogelijk om VAC als een CSV-bestand te importeren via de API.
2 participants