Skip to content

Commit

Permalink
Fix result not defined error
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaledgarbaya committed Feb 6, 2020
1 parent 60c503b commit 0026600
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions lambda-src/identity-signup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fetch = require("node-fetch")

exports.handler = async function(event, context) {
exports.handler = async function(event, context, callback) {
const { user } = JSON.parse(event.body)

const responseBodyString = JSON.stringify({
Expand All @@ -18,8 +18,6 @@ exports.handler = async function(event, context) {
},
})

console.log(responseBodyString)

const result = await fetch("https://rubbergoose.herokuapp.com/v1/graphql", {
method: "POST",
body: responseBodyString,
Expand All @@ -32,14 +30,14 @@ exports.handler = async function(event, context) {

if (errors) {
console.log(errors)
return {
return callback({
statusCode: 500,
body: "Something is wrong",
}
})
} else {
return {
return callback({
statusCode: 200,
body: JSON.stringify(data),
}
})
}
}
Loading

0 comments on commit 0026600

Please sign in to comment.