Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertofrontado/6763cb699fd16d2b8c9c46af80e9223a to your computer and use it in GitHub Desktop.
Save robertofrontado/6763cb699fd16d2b8c9c46af80e9223a to your computer and use it in GitHub Desktop.
serverless-todo-deletetodo-with-service
import 'source-map-support/register'
import { APIGatewayProxyHandler, APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'
import TodoService from '../../services/todoService'
export const handler: APIGatewayProxyHandler = async (event: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> => {
const id = event.pathParameters.id
const todoService = new TodoService()
await todoService.deleteTodoById(id)
return {
statusCode: 200,
body: ''
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment