JAGFx / ets2-dashboard-skin-servers

MIT License
0 stars 0 forks source link

Create an endpoint to update all user configuration form file mock #4

Open JAGFx opened 1 year ago

JAGFx commented 1 year ago

POST /users-preferences-file

Body: Fichier JSON Object with list of key:value

Key: UserPreferenceId Value: UserPreferenceValue

Parse and convert, update the user preference in right file.

Rules

If key start with general_, store in config.json Else store on corresponding current game file => ETS2: config.ets2.json => ATS: config.ats.json

Validation

All key pass must be part of existing preferences entries, and value in acceptable values Full list in lib project: src/configuration/preference-entry/list.json

If it does not match, ignore update and return the corresponding error