Skip to content

Enable to import vac as CSV#993

Merged
AliKdhim87 merged 5 commits intomainfrom
enable-to-import-vac-as-csv
Jan 17, 2025
Merged

Enable to import vac as CSV#993
AliKdhim87 merged 5 commits intomainfrom
enable-to-import-vac-as-csv

Conversation

@AliKdhim87
Copy link
Collaborator

@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

@vercel
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

@codecov
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%> (ø)

@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

@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
6 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