It should be returning the generated credit object, and is just returning the ID.
Created attachment 121292 [details] [review] Bug 28424: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 121293 [details] [review] Bug 28424: Fix patron credits route (POST) This patch makes the route follow the coding guidelines and thus: - Return the generated object - Use the status code 201 for the response To test: 1. Apply the tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons_accounts.t => FAIL: Tests fail. The reponse body and status is incorrect 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 121294 [details] [review] Bug 28424: (28370 follow-up) Fix response definition Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 121295 [details] [review] Bug 28424: (follow-up) Do not create account lines manually Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 121304 [details] [review] Bug 28424: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 121305 [details] [review] Bug 28424: Fix patron credits route (POST) This patch makes the route follow the coding guidelines and thus: - Return the generated object - Use the status code 201 for the response To test: 1. Apply the tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons_accounts.t => FAIL: Tests fail. The reponse body and status is incorrect 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 121306 [details] [review] Bug 28424: (28370 follow-up) Fix response definition Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 121307 [details] [review] Bug 28424: (follow-up) Do not create account lines manually Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Pushed to master for 21.05, thanks to everybody involved!
Does not apply on 20.11.x for t/db_dependent/api/v1/patrons_accounts.t Because of Bug 27587 it seems.