Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement config update API #240

Open
shadinaif opened this issue Feb 26, 2025 · 0 comments
Open

feat: Implement config update API #240

shadinaif opened this issue Feb 26, 2025 · 0 comments
Assignees

Comments

@shadinaif
Copy link
Collaborator

shadinaif commented Feb 26, 2025

Description:

Replace the mock API to a real one PUT /api/fx/config/v1/draft

Steps to apply the update:

  • Verify that the user can edit the key
  • If reset option is on; then delete the key from the draft
  • If reset option is off; then update the field with multi-user edit check:
    • create a function receives current_value, new_value, and key_path
    • the function update the value of the key specified in key_path if:
{{key_path}} does not exist AND config_draft.{{key_path}} does not exist
OR
config_draft.{{key_path}} exists AND current_value matches the current value of config_draft.{{key_path}}
OR
config_draft.{{key_path}} does not exist AND {{key_path}} exists AND current_value matches the current value of {{key_path}}

Important:

  • Apply the update using ORM update and filter with no value comparison in the Python level. Because using fetch and compare will defeat the purpose of the (multi-user edit check) mechanism

Related PRs:

  • to be filled by the SE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants