From 2600c6f38cebf59fa3c0f12422b13d58988bbc7d Mon Sep 17 00:00:00 2001 From: davidwells Date: Mon, 11 Jun 2018 16:39:45 -0700 Subject: [PATCH] update exports --- functions/todos-create.js | 2 +- functions/todos-delete.js | 2 +- functions/todos-read-all.js | 2 +- functions/todos-read-one.js | 4 ++-- functions/todos-update.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/functions/todos-create.js b/functions/todos-create.js index 78173fc..a657b46 100644 --- a/functions/todos-create.js +++ b/functions/todos-create.js @@ -7,7 +7,7 @@ const client = new faunadb.Client({ secret: process.env.FAUNADB_SECRET }); -module.exports = (event, callback) => { +exports.handler = (event, context, callback) => { const data = JSON.parse(event.body); console.log("create todo", data); return client.query(q.Create(q.Ref("classes/todos"), {data})) diff --git a/functions/todos-delete.js b/functions/todos-delete.js index 0e2f105..981db69 100644 --- a/functions/todos-delete.js +++ b/functions/todos-delete.js @@ -7,7 +7,7 @@ const client = new faunadb.Client({ secret: process.env.FAUNADB_SECRET }); -module.exports = (event, callback) => { +exports.handler = (event, context, callback) => { console.log("delete todo"); return client.query(q.Delete(q.Ref("classes/todos/"+event.pathParameters.id))) .then((response) => { diff --git a/functions/todos-read-all.js b/functions/todos-read-all.js index fa51b38..f69162a 100644 --- a/functions/todos-read-all.js +++ b/functions/todos-read-all.js @@ -7,7 +7,7 @@ const client = new faunadb.Client({ secret: process.env.FAUNADB_SECRET }); -module.exports = (event, callback) => { +exports.handler = (event, context, callback) => { console.log("readAll todo"); return client.query(q.Paginate(q.Match(q.Ref("indexes/all_todos")))) .then((response) => { diff --git a/functions/todos-read-one.js b/functions/todos-read-one.js index 64b65c4..df95a52 100644 --- a/functions/todos-read-one.js +++ b/functions/todos-read-one.js @@ -7,8 +7,8 @@ const client = new faunadb.Client({ secret: process.env.FAUNADB_SECRET }); -module.exports = (event, callback) => { - console.log("readOne todo "+event.pathParameters.id); +exports.handler = (event, context, callback) => { + console.log(`readOne todo ${event.pathParameters.id}`); return client.query(q.Get(q.Ref("classes/todos/"+event.pathParameters.id))) .then((response) => { console.log("success", response); diff --git a/functions/todos-update.js b/functions/todos-update.js index 33f1e52..ea5f5a9 100644 --- a/functions/todos-update.js +++ b/functions/todos-update.js @@ -7,7 +7,7 @@ const client = new faunadb.Client({ secret: process.env.FAUNADB_SECRET }); -module.exports = (event, callback) => { +exports.handler = (event, context, callback) => { const data = JSON.parse(event.body); console.log("update todo"); return client.query(q.Update(q.Ref("classes/todos/"+event.pathParameters.id), {data}))