Skip to content

Commit

Permalink
Integrate UI with create account resource
Browse files Browse the repository at this point in the history
  • Loading branch information
jadmsaadaot committed Jul 31, 2024
1 parent c557b16 commit 34d3298
Show file tree
Hide file tree
Showing 13 changed files with 2,758 additions and 7,236 deletions.
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.formatOnType": false, // required
"editor.formatOnPaste": true, // optional
"editor.formatOnSave": true, // optional
"editor.formatOnSaveMode": "file", // required to format on save
"files.autoSave": "onFocusChange", // optional but recommended
"vs-code-prettier-eslint.prettierLast": false // set as "true" to run 'prettier' last not first
}
2 changes: 1 addition & 1 deletion submit-api/src/submit_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def create_app(run_mode=os.getenv('FLASK_ENV', 'development')):
# All configuration are in config file
app.config.from_object(get_named_config(run_mode))

CORS(app, resources={r"/*": {"origins": allowedorigins()}}, supports_credentials=True)
CORS(app, origins=allowedorigins(), supports_credentials=True)

# Register blueprints
app.register_blueprint(API_BLUEPRINT)
Expand Down
3 changes: 2 additions & 1 deletion submit-api/src/submit_api/resources/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from http import HTTPStatus

from flask_restx import Namespace, Resource
from flask_restx import Namespace, Resource, cors
from submit_api.services.account_service import AccountService
from submit_api.utils.util import cors_preflight
from submit_api.schemas.account import AccountSchema, AccountCreateSchema
Expand Down Expand Up @@ -52,6 +52,7 @@ def get():
@API.expect(account_create_model)
@API.response(code=HTTPStatus.CREATED, model=account_list_model, description="Account Created")
@API.response(HTTPStatus.BAD_REQUEST, "Bad Request")
@cors.crossdomain(origin="*")
def post():
"""Create an account."""
account_data = AccountCreateSchema().load(API.payload)
Expand Down
Loading

0 comments on commit 34d3298

Please sign in to comment.