diff --git a/src/usertasks-lambda/src/handlers/tasks.rs b/src/usertasks-lambda/src/handlers/tasks.rs index 71ab9a1..e74a090 100644 --- a/src/usertasks-lambda/src/handlers/tasks.rs +++ b/src/usertasks-lambda/src/handlers/tasks.rs @@ -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?; diff --git a/template.yaml b/template.yaml index f2c81e2..7887ad2 100644 --- a/template.yaml +++ b/template.yaml @@ -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 @@ -169,7 +169,7 @@ Resources: Type: Api Properties: Path: /v1/user/{user_id}/tasks/{task_id} - Method: delete + Method: post RestApiId: !Ref BustleItApi Outputs: