Skip to content

Commit 7ffeec5

Browse files
author
joel@joellee.org
committed
feat: version 0.1.4
1 parent 883661f commit 7ffeec5

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Deploy your function as per documentation.
1111

1212

1313
```python3
14-
14+
import asyncio
1515
from supafunc import FunctionsClient
1616
async def run_func():
1717
fc = FunctionsClient("https://<project_ref>.functions.supabase.co", {})
1818
res = await fc.invoke("payment-sheet", {"responseType": "json"})
1919

2020
if __name__ == "__main__":
2121
asyncio.run(run_func())
22-
```
22+
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "supafunc"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
description = "Library for Supabase Functions"
55
authors = ["Joel Lee <joel@joellee.org>"]
66
license = "MIT"

supafunc/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
__version__ = "0.1.3"
2-
from supafunc import FunctionsClient
3-
1+
__version__ = "0.1.4"
2+
from .supafunc import FunctionsClient

supafunc/supafunc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from typing import Dict
21
import httpx
2+
from typing import Dict
33

44

55
class FunctionsClient:
@@ -35,11 +35,11 @@ async def invoke(self, function_name: str, invoke_options: Dict) -> Dict:
3535
Dictionary with data and/or error message
3636
"""
3737
try:
38-
headers = invoke_options.get('headers')
38+
headers = {**self.headers, **invoke_options.get('headers')}
3939
body = invoke_options.get('body')
4040
response_type = invoke_options.get('responseType')
4141
response = httpx.post(
42-
f"{self.url}/{function_name}", headers=headers)
42+
f"{self.url}/{function_name}", headers=headers, json=body)
4343
is_relay_error = response.headers.get('x-relay-header')
4444
if is_relay_error and is_relay_error == 'true':
4545
return {

0 commit comments

Comments
 (0)