Bug 23269: (RM follow-up) Strip item_group and item_level_holds_count from hold POST body

Bug 23269 added item_group and item_level_holds_count to the hold
response schema (hold.yaml). buildSampleObject reads hold.yaml to
generate test hold objects, so these fields are now included in the
generated object. However, the holds POST endpoint uses an inline
schema with additionalProperties: false that does not include these
fields, causing a 400 validation error when insertSampleHold tries
to create a hold via the API.

Add item_group and item_level_holds_count to the destructuring
strip-list in insertObject so they are excluded from the POST body.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2026-03-22 06:42:29 +00:00
parent 9ed90d53fb
commit b91ff527a2
No known key found for this signature in database
GPG Key ID: 2D86E0EAEC83711B
1 changed files with 2 additions and 0 deletions

View File

@ -737,6 +737,8 @@ const insertObject = async ({ type, object, baseUrl, authHeader }) => {
_strings,
hold_group_id,
item_level,
item_level_holds_count,
item_group,
cancellation_requested,
biblio,
deleted_biblio,