-
Notifications
You must be signed in to change notification settings - Fork 108
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 model #4332
Add model #4332
Conversation
Demo starting at https://snapcraft-io-4332.demos.haus |
Codecov Report
@@ Coverage Diff @@
## main #4332 +/- ##
==========================================
- Coverage 87.51% 82.02% -5.50%
==========================================
Files 95 196 +101
Lines 6656 9808 +3152
Branches 0 801 +801
==========================================
+ Hits 5825 8045 +2220
- Misses 831 1641 +810
- Partials 0 122 +122
Flags with carried forward coverage won't be shown. Click here to find out more.
|
webapp/admin/views.py
Outdated
res = {} | ||
try: | ||
models = admin_api.get_store_models(flask.session, store_id) | ||
res["message"] = "Models retrieved" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the request is successful we don't need a message :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all requests? Or for the get requests only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All successful requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 small change plz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
Done
get_model
:[GET] /admin/store/<store_id>/models
create_model
:[POST] /admin/store/<store_id>/models
update_model
:[PATCH] /admin/store/<store_id>/models/<model_name>
How to QA
/login-beta
get_model
: Go to https://snapcraft-io-4332.demos.haus/admin/store/njwQYXFnS7ppo7LaGxoh7aqVZc1CPi26/models and ensure that a response object containingmessage, success, and data
is returnedpost_model
: thepost
endpoint can be tested by sending the request from the frontend client with payload{"name": string, "api_key": string}
update_model
: similar to the post endpoint should also be tested from the frontend client. payload:{"api_key": string}
Issue / Card https://warthogs.atlassian.net/browse/WD-4657
NOTE
THIS ENDPOINT ONLY WORKS WHEN USER AUTHENTICATE WITH LOGIN BETA FOR NOW.
Screenshots