[Koha-bugs] [Bug 26635] Expand authorised values in REST API call

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Feb 3 09:43:28 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26635

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin.renvoize at ptfs-europe
                   |                            |.com

--- Comment #17 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
This is interesting, and the code is nice to follow.

I wonder a bit about the output form however... should we not expand AV's
inline?

So rather than:

GET /api/v1/items/1

{
    "_authorised_values": {
        "location": {
            "authorised_value": "GEN",
            "category": "LOC",
            "id": 27,
            "imageurl": null,
            "lib": "General Stacks",
            "lib_opac": null
        }
    },
    "acquisition_date": "2014-05-07",
    "acquisition_source": null,
    "biblio_id": 1,
    "item_id": 1,
    ...
    "location": "GEN",
    ...
    "uri": null,
    "withdrawn": 0,
    "withdrawn_date": null
}

We would do

GET /api/v1/items/1

{
    "acquisition_date": "2014-05-07",
    "acquisition_source": null,
    "biblio_id": 1,
    "item_id": 1,
    ...
    "location": {
        "code": "GEN",
        "description": "General Stacks",
        "imageurl": null
    },
    ...
    "uri": null,
    "withdrawn": 0,
    "withdrawn_date": null
}

and

GET /public/items/1

{
    "acquisition_date": "2014-05-07",
    "acquisition_source": null,
    "biblio_id": 1,
    "item_id": 1,
    ...
    "location": {
        "code": "GEN",
        "description": null,
        "imageurl": null
    },
    ...
    "uri": null,
    "withdrawn": 0,
    "withdrawn_date": null
}

This would more closely resemble how we return the data in the existing UI's.

I'm not sure we need the full AV object expanded.. and I'm thinking if would be
'nicer' to access it directly rather than have to do a subsequent lookup in JS?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list