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

add validation when create/update App #2020

Merged
merged 1 commit into from
Mar 24, 2025
Merged

Conversation

nquang29
Copy link
Collaborator

@nquang29 nquang29 commented Mar 15, 2025

@nquang29
Copy link
Collaborator Author

@beastoin pls help me to review

@beastoin
Copy link
Collaborator

1/ learn about the pydantic model then apply it.

@nquang29

@nquang29 nquang29 force-pushed the be_2011 branch 2 times, most recently from 1d99006 to c871d2c Compare March 16, 2025 18:48
@nquang29
Copy link
Collaborator Author

1/ attempted to apply pydantic. pls help me to review again @beastoin

@beastoin
Copy link
Collaborator

1/ ok
2/ one more step, only accept specific fields on updating the app, for example we should not approve update the admin-fields such as approved, status, remember the form models in Gin ?

@nquang29

@nquang29
Copy link
Collaborator Author

2/ i defined list restricted fields to prevent user from update this @beastoin

@beastoin
Copy link
Collaborator

2/ use whitelist instead of blacklist. we should have the allowed fields for creation as well.

@nquang29 last commit please 😌

@nquang29
Copy link
Collaborator Author

2/ done sir @beastoin . but i think we should separate model to AppUpdate, AppCreate for api create/update

@beastoin
Copy link
Collaborator

2/ separating the model, do it pls @nquang29

@nquang29
Copy link
Collaborator Author

2/ done sir @beastoin

@beastoin beastoin merged commit 79d9d17 into BasedHardware:main Mar 24, 2025
@beastoin
Copy link
Collaborator

lgtm @nquang29 🌚

Next, let's make the model a bit more generic and share your test with our app (in dev env).

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

Successfully merging this pull request may close these issues.

2 participants