uchicago-library / library_website

The University of Chicago Library Website
5 stars 5 forks source link

StaffPage API should include supervisor information #235

Open bbusenius opened 4 years ago

bbusenius commented 4 years ago

Expected behavior

The StaffPage API that is documented in loop should contain supervisor information in the JSON response. This would be information about who each individual reports to. This information could be useful to other library applications.

Actual behavior

There is a supervises_students boolean, however, who each individual reports to is not included.

Steps to reproduce

Go to the StaffPage API and look at the fields returned for each individual.

Related materials

Related code

Most likely this information can be added using the get_supervisors method on the StaffPage object.

Other information:**

fseatonuc commented 4 years ago

On a related issue - instead of, or perhaps, in addition to - it would be useful to me (and maybe Matt) to have an api to return unit.UnitPage information. For the travel/training application, supervisor information isn't really necessary as they don't require that an employee select their direct supervisor as part of the approval process. I need to know the organizational structure so I can pick the supervisors of the Divisions and the supervisors of the Departments that are one level below each division and it appears that all of that information is contained in the 'Unit' pages.

Perhaps an api like:
https://loop.lib.uchicago.edu/api/v2/pages/?format=json&limit=1000&type=unit.UnitPage&fields=*