Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feature: TT-430 disable cors on development mode
  • Loading branch information
mandres2015 committed Dec 1, 2021
commit 1897546bdeb692b3b37ed709265d29cfdc1b7a53
11 changes: 10 additions & 1 deletion V2/local.settings.json
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
{"IsEncrypted":false,"Values":{"AzureWebJobsStorage":"UseDevelopmentStorage=true","FUNCTIONS_WORKER_RUNTIME":"python"}}
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "python"
},
"Host": {
"CORS": "*"
}
}
2 changes: 1 addition & 1 deletion V2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"offline": "serverless offline -a '--cors *'",
"offline": "serverless offline",
"deploy": "serverless deploy"
},
"author": "",
Expand Down
22 changes: 2 additions & 20 deletions V2/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ functions:
- GET
route: activities/{id:?}
authLevel: anonymous
cors: true

delete_activity:
handler: time_tracker/activities/interface.delete_activity
Expand All @@ -62,7 +61,6 @@ functions:
- DELETE
route: activities/{id}
authLevel: anonymous
cors: true

update_activity:
handler: time_tracker/activities/interface.update_activity
Expand All @@ -73,7 +71,6 @@ functions:
- PUT
route: activities/{id}
authLevel: anonymous
cors: true

create_activity:
handler: time_tracker/activities/interface.create_activity
Expand All @@ -84,7 +81,6 @@ functions:
- POST
route: activities/
authLevel: anonymous
cors: true

#endregion End Functions Activities

Expand All @@ -99,7 +95,6 @@ functions:
- POST
route: time-entries/
authLevel: anonymous
cors: true

get_time_entries:
handler: time_tracker/time_entries/interface.get_time_entries
Expand All @@ -110,7 +105,6 @@ functions:
- GET
route: time-entries/{id:?}
authLevel: anonymous
cors: true

delete_time_entry:
handler: time_tracker/time_entries/interface.delete_time_entry
Expand All @@ -121,7 +115,6 @@ functions:
- DELETE
route: time-entries/{id}
authLevel: anonymous
cors: true

update_time_entry:
handler: time_tracker/time_entries/interface.update_time_entry
Expand All @@ -131,8 +124,7 @@ functions:
methods:
- PUT
route: time-entries/{id}
authLevel: anonymous
cors: true
authLevel: anonymous

get_latest_time_entry:
handler: time_tracker/time_entries/interface.get_latest_entries
Expand All @@ -143,7 +135,6 @@ functions:
- GET
route: time-entries/latest/
authLevel: anonymous
cors: true

#endregion End Functions Time-Entries

Expand All @@ -158,7 +149,6 @@ functions:
- POST
route: customers/
authLevel: anonymous
cors: true

get_customers:
handler: time_tracker/customers/interface.get_customers
Expand All @@ -169,7 +159,6 @@ functions:
- GET
route: customers/{id:?}
authLevel: anonymous
cors: true

update_customer:
handler: time_tracker/customers/interface.update_customer
Expand All @@ -180,7 +169,6 @@ functions:
- PUT
route: customers/{id}
authLevel: anonymous
cors: true

delete_customer:
handler: time_tracker/customers/interface.delete_customer
Expand All @@ -191,7 +179,6 @@ functions:
- DELETE
route: customers/{id}
authLevel: anonymous
cors: true

#endregion End Functions Customers

Expand All @@ -206,7 +193,6 @@ functions:
- GET
route: projects/{id:?}
authLevel: anonymous
cors: true

delete_project:
handler: time_tracker/projects/interface.delete_project
Expand All @@ -217,7 +203,6 @@ functions:
- DELETE
route: projects/{id}
authLevel: anonymous
cors: true

update_project:
handler: time_tracker/projects/interface.update_project
Expand All @@ -227,8 +212,7 @@ functions:
methods:
- PUT
route: projects/{id}
authLevel: anonymous
cors: true
authLevel: anonymous

create_project:
handler: time_tracker/projects/interface.create_project
Expand All @@ -240,7 +224,6 @@ functions:
route: projects/

authLevel: anonymous
cors: true

get_latest_projects:
handler: time_tracker/projects/interface.get_latest_projects
Expand All @@ -251,7 +234,6 @@ functions:
- GET
route: projects/latest
authLevel: anonymous
cors: true

#endregion End Functions Projects

Expand Down
4 changes: 3 additions & 1 deletion V2/time_tracker/activities/_application/_activities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ def parse_status_to_string_for_ui(activity: dict) -> dict:


def parse_status_to_number(status: str) -> int:
return StatusEnums[status].value
if(isinstance(status, str)):
return StatusEnums[status].value
return status