diff --git a/functions/todos-create.js b/functions/todos-create.js index 198c27a..a0333fa 100644 --- a/functions/todos-create.js +++ b/functions/todos-create.js @@ -7,7 +7,7 @@ const client = new faunadb.Client({ exports.handler = (event, context, callback) => { const data = JSON.parse(event.body) - console.log("create todo", data) + console.log("Function `todo-create` invoked") return client.query(q.Create(q.Ref("classes/todos"), {data})) .then((response) => { console.log("success", response) diff --git a/functions/todos-delete.js b/functions/todos-delete.js index ea36016..84d04e2 100644 --- a/functions/todos-delete.js +++ b/functions/todos-delete.js @@ -7,7 +7,7 @@ const client = new faunadb.Client({ exports.handler = (event, context, callback) => { const id = event.path.replace(/\/\.netlify\/functions\/todos-delete\//, "") - console.log("delete todo", id) + console.log(`Function 'todo-delete' invoked. delete id: ${id}`) return client.query(q.Delete(q.Ref(`classes/todos/${id}`))) .then((response) => { console.log("success", response) diff --git a/functions/todos-read-all.js b/functions/todos-read-all.js index 3815142..14076ed 100644 --- a/functions/todos-read-all.js +++ b/functions/todos-read-all.js @@ -6,7 +6,7 @@ const client = new faunadb.Client({ }) exports.handler = (event, context, callback) => { - console.log("readAll todos") + console.log("Function `todo-read-all` invoked") return client.query(q.Paginate(q.Match(q.Ref("indexes/all_todos")))) .then((response) => { console.log("success", response) diff --git a/functions/todos-read.js b/functions/todos-read.js index 76ecf5e..c07666d 100644 --- a/functions/todos-read.js +++ b/functions/todos-read.js @@ -7,7 +7,7 @@ const client = new faunadb.Client({ exports.handler = (event, context, callback) => { const id = event.path.replace(/\/\.netlify\/functions\/todos-read\//, "") - console.log(`readOne todo ${id}`) + console.log(`Function 'todo-read' invoked. Read id: ${id}`) return client.query(q.Get(q.Ref(`classes/todos/${id}`))) .then((response) => { console.log("success", response) diff --git a/functions/todos-update.js b/functions/todos-update.js index 71e9f42..90f5ee0 100644 --- a/functions/todos-update.js +++ b/functions/todos-update.js @@ -8,7 +8,7 @@ const client = new faunadb.Client({ exports.handler = (event, context, callback) => { const data = JSON.parse(event.body) const id = event.path.replace(/\/\.netlify\/functions\/todos-update\//, "") - console.log("update todo", id) + console.log(`Function 'todo-update' invoked. update id: ${id}`) return client.query(q.Update(q.Ref(`classes/todos/${id}`), {data})) .then((response) => { console.log("success", response)