-
-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Labels
bugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already exists
Description
Bug report
The documentation shows calling a function as:
const { data: user, error } = await supabase.functions.invoke('hello', {
responseType: 'text',
body: { foo: 'bar' }
})
The function.js code has
const response = await this.fetch(`${this.url}/${functionName}`, {
method: 'POST',
headers: Object.assign({}, this.headers, headers),
body,
})
I would think at a minimum body should be body:body.
Very strange results occur, but basically content length is string length if {body:'string'} is used in call.
If an object is used {body:{k:'v'}, length is always 15 probably an error message for invalid object or something...
Not sure if it is related. But all calls generate cors errors:
To Reproduce
Follow the instructions for functions invoke in api reference.
Expected behavior
Body should be formatted correctly and no cors error (if not related)
System information
Latest supabase.js
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already exists