init commit ⊂◉‿◉つ
This commit is contained in:
commit
c8c51623a6
19 changed files with 7568 additions and 0 deletions
19
functions/todos-delete.js
Normal file
19
functions/todos-delete.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
'use strict';
|
||||
|
||||
const faunadb = require('faunadb');
|
||||
const q = faunadb.query;
|
||||
const client = new faunadb.Client({
|
||||
secret: process.env.FAUNADB_SECRET
|
||||
});
|
||||
|
||||
module.exports = (event, callback) => {
|
||||
console.log("delete todo");
|
||||
return client.query(q.Delete(q.Ref("classes/todos/"+event.pathParameters.id)))
|
||||
.then((response) => {
|
||||
console.log("success", response);
|
||||
callback(false, response);
|
||||
}).catch((error) => {
|
||||
console.log("error", error);
|
||||
callback(error)
|
||||
})
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue