sulu / SuluHeadlessBundle

Bundle that provides controllers and services for using Sulu as headless content management system
MIT License
45 stars 25 forks source link

Change View Responses for single and multi selections #46

Closed alexander-schranz closed 3 years ago

alexander-schranz commented 4 years ago

For a single selection the view response currently look like this:

[$data] // [1]

A multi selection look like this:

$data // [1, 2, 3]

This does make the view parameter not extendable if we maybe add displayOptions or other things to our selection content types.

Proposal

For a single selection I would like something like:

[
     'id' => $data,
]

And for the multi selection something like:

[
     'ids' => $data,
]

This would then also be consistent to the exist media_selection and single_media_selection which are currently using the proposed format. /cc @wachterjohannes @nnatter what do you think?

niklasnatter commented 4 years ago

Sounds good to me! 🙂