From 7085cc92b5cb4696350b6b5dbb18235f60b9c705 Mon Sep 17 00:00:00 2001 From: Tristian Barrett Date: Fri, 12 Jun 2020 10:47:17 +0100 Subject: [PATCH] Add lambda endpoint for updating from airtable --- serverless.yml | 8 ++++++++ src/LambdaFunctions.fs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/serverless.yml b/serverless.yml index c4a915c..3ebcae5 100755 --- a/serverless.yml +++ b/serverless.yml @@ -64,6 +64,14 @@ functions: path: "/cards" cors: true + updateCardsFromAirtable: + handler: BigHack.Fumble.Api::BigHack.Fumble.Api.LambdaFunctions::updateFromAirtable + events: + - http: + method: POST + path: "/updateFromAirtable" + cors: true + resources: Resources: CardsDynamoDBTable: diff --git a/src/LambdaFunctions.fs b/src/LambdaFunctions.fs index 4ba7f25..073ba3d 100644 --- a/src/LambdaFunctions.fs +++ b/src/LambdaFunctions.fs @@ -32,5 +32,5 @@ let updateFromAirtable (gatewayRequest : APIGatewayProxyRequest) Ok () |> handleJsonRequest lambdaContext "UpdateCards" - Workflow.updateFromAirtable + (fun ctx () -> Workflow.updateFromAirtable ctx) ResponseDto.mapEmptyResultToDto