Skip to content

Commit

Permalink
Workaround BUGIX: fn delete_task DELETE -> POST
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaybu committed Dec 7, 2024
1 parent 899022a commit 63efff0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/usertasks-lambda/src/handlers/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub async fn update_task(
Ok(Json(Task::from(task)))
}

// DELETE /v1/user/:user_id/tasks/:task_id
// POST /v1/user/:user_id/tasks/:task_id
pub async fn delete_task(Path((user_id, task_id)): Path<(Uuid, Uuid)>) -> Result<()> {
let db = TasksDb::new().await?;
db.delete_task(user_id, task_id).await?;
Expand Down
4 changes: 2 additions & 2 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Resources:
StageName: Prod
Cors:
AllowMethods: "'GET, POST, PUT, DELETE, PATCH, OPTIONS'"
AllowHeaders: "'*'"
AllowHeaders: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Requested-With'"
AllowOrigin: "'*'"
MaxAge: "'86400'"
AllowCredentials: false
Expand Down Expand Up @@ -169,7 +169,7 @@ Resources:
Type: Api
Properties:
Path: /v1/user/{user_id}/tasks/{task_id}
Method: delete
Method: post
RestApiId: !Ref BustleItApi

Outputs:
Expand Down

0 comments on commit 63efff0

Please sign in to comment.