From ba40a9c203e0c14640ee7314414ab8be90d46343 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 2 Jan 2020 17:32:54 +0200 Subject: [PATCH] fsharp(todolist-api): refactor: removed unused variables Signed-off-by: prescientmoon --- fsharp/todolist-api/src/App.fs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fsharp/todolist-api/src/App.fs b/fsharp/todolist-api/src/App.fs index 83e655e..61fdedb 100644 --- a/fsharp/todolist-api/src/App.fs +++ b/fsharp/todolist-api/src/App.fs @@ -30,25 +30,23 @@ module App = let dbTodo = ctx |> Queries.getTodosById id match dbTodo with - | Some inner -> f (inner, ctx, id) + | Some inner -> f (inner, ctx) | None -> id |> sprintf "Cannot find todo with id %i" |> NOT_FOUND let todoById = - withTodoById (fun (inner, _, _) -> respondWithTodo inner) + withTodoById (fun (inner, _) -> respondWithTodo inner) let updateTodo = - withTodoById (fun (todo, dbContext, id) -> + withTodoById (fun (todo, dbContext) -> fun ctx -> async { let body: Types.TodoDetails = parseJson ctx.request.rawForm do! Queries.updateTodoById todo body dbContext - + return! respondWithTodo todo ctx }) - let patchTodo = withTodoById (fun (todo, dbContext, id) -> - let originalTodo = todoToRecord todo - + let patchTodo = withTodoById (fun (todo, dbContext) -> fun ctx -> async { let body: Types.PartialTodoDetails = parseJson ctx.request.rawForm