https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42625 --- Comment #246 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211271 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211271&action=edit Bug 42625: Accept and return library groups on record sources api Record sources can now be linked to library groups through the API. - library_groups can be embedded (x-koha-embed) when listing or fetching record sources - POST and PUT /api/v1/record_sources accept a library_groups list of { library_group_id }. On update, leaving the key out keeps the current links, and an empty list clears them - a group that cannot be linked (it does not exist, is not a top level group, or is not flagged for record source editing) is answered with a 400 on /body/library_groups - the record source and its links are saved in one transaction To test: 1. Apply the patches, then run updatedatabase.pl, yarn build and restart_all 2. Administration > Library groups: create a group "Editors" with "Use for record source editing" checked 3. Administration > Record sources > New record source. Give it a name and select "Editors" under "Editable by library groups" (this needs the record source form patch of this series), then save 4. Edit the record source again => SUCCESS: "Editors" is still selected 5. Run: prove t/db_dependent/api/v1/record_sources.t xt/api.t => SUCCESS: Tests pass Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.