altinn-studio
altinn-studio copied to clipboard
Create controller and service for options/code lists
Description
In this PR an OptionsController
and an OptionsService
has been created.
The OptionsService
uses the AltinnAppGitRepository
to manipulate the options files.
5 new endpoints have been added:
- GET an array of the names of all option lists from a repo
- GET a single option list from a repo
- POST a single option list to a repo
- PUT a single option list to a repo
- DELETE a single option list from a repo
Considerations
- I was unsure what to call the methods, e.g.
GetOptions
,GetOptionLists
orGetCodeLists
. What do you think? - I'm not 100% sure if my usage of CancellationToken is correct. Please keep it in the back of your mind when reviewing.
- These endpoints only handle static code lists. Is there a need for endpoints for dynamic code lists?
Related Issue(s)
- #12873
Verification
- [x] Your code builds clean without any errors or warnings
- [x] Manual testing done (required) - tested OK with Postman when temporarily disabling
[AutoValidateAntiforgeryToken]
- [x] Relevant automated test added (if you find this hard, leave it and we'll help out)