This issue is to be used for tracking a number of site api issues which are all linked. Currently a rewrite of how the Sites Controller works needs to be done so that the following routes are available:
/sites:
[x] list
[x] filter
[x] show
[x] create
body: {name: 'hello'} => orphan site
body: {name: 'world', project_ids: [456]} => site in project 456
body: {name: 'world', project_ids: [123, 456]} => site in project 123 and 456
[x] update
Accepts changes to project_ids
[x] destroy
Soft delete model on request
[x] orphans
Admin only?
/projects/:project_id/sites:
[x] list
[x] filter
[x] show
[x] create
Ignores project_ids
[x] update
Ignores project_ids
[x] destroy
Soft delete model on request
It should be possible to redesign the Site Controller functions so that the same function can handle each CRUD case. Ie. There should no longer exist show() and show_shallow().
The following issues are related to this and should be fixed during the process:
[x] #437 (failing sites filter route)
[x] #431 (missing generic sites route)
[x] #430 (missing orphan sites route)
[x] #410 (create site route ignoring inputs)
[x] #406 (some site fields are not exposed in the api)
This issue is to be used for tracking a number of site api issues which are all linked. Currently a rewrite of how the Sites Controller works needs to be done so that the following routes are available:
/sites
:project_ids
/projects/:project_id/sites
:project_ids
project_ids
It should be possible to redesign the Site Controller functions so that the same function can handle each CRUD case. Ie. There should no longer exist
show()
andshow_shallow()
.The following issues are related to this and should be fixed during the process: