api.serlo.org
api.serlo.org copied to clipboard
entitySet: do not ignore `licenseId` set by editor
What is wrong?
Currently the API always uses the default license when creating new entities: https://github.com/serlo/api.serlo.org/blob/staging/packages/server/src/schema/uuid/abstract-entity/entity-set-handler.ts#L151
How should it behave?
It would be nice if the API would use the licenseId set in the editor (in the serlo-template-plugins).
Proposed Solution
We need to parse the entity content (outermost plugin) and retrieve and use the licenseId if there is one. Otherwise falling back to default like before is fine.
(https://github.com/serlo/frontend/pull/3501)