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

Feat: Support for bulk insertion #931

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

b4dnewz
Copy link

@b4dnewz b4dnewz commented Mar 19, 2019

Added support for bulk insertion when posting array to plural and nested routes.

POST /posts 
POST /posts/1/comments

When a single object is posted it work as usual, when an array (of objects) is posted it will perform bulk insertion.

Also the id field is parsed into number to fix match issues, see #396

Filippo Conti added 2 commits March 19, 2019 13:17
Threat the request param as integer
closes typicode#925, closes typicode#396
Added support for bulk insertion on plural routes and nested routes, closes typicode#482
@Alewex
Copy link

Alewex commented Jun 14, 2019

@typicode could we get this feature merged?

@jameskirkpatrick23
Copy link

jameskirkpatrick23 commented Jun 26, 2019

Any updates on when this may get merged?

@wilgert
Copy link

wilgert commented Aug 16, 2019

I completely forgot that id can be non numeric also.. I'll update this and put some tests for that too, thanks!

We actually needed the fix really badly, so we created our own fix.
See: https://github.com/NavaraBV/json-server/commit/699c27e82e33d08aceef5fa8fc53dd6cd7070ec7

(somehow the test that is commented out there was failing on my machine, you can ignore that change)

When nested route is called with a non numeric id it should not be parsed to int, otherwise numbers or numeric strings are parsed to int with base 10
@wilgert
Copy link

wilgert commented Aug 20, 2019

LGTM now!

@alesmit
Copy link

alesmit commented May 8, 2020

Any reason why this hasn't been merged yet?

@Saunved
Copy link

Saunved commented Jul 6, 2020

Will this be merged soon?

Copy link

@foxleigh81 foxleigh81 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants