Skip to content
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ let package = Package(
.executable(name: "example", targets: ["example"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(
name: "SnapshotTesting",
url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.8.1"
Expand Down
9 changes: 6 additions & 3 deletions Sources/PostgREST/PostgrestRpcBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ public class PostgrestRpcBuilder: PostgrestBuilder {
method = "POST"
body = parameters
return PostgrestTransformBuilder(
url: url, queryParams: queryParams, headers: headers, schema: schema, method: schema,
body: body
)
url: url,
queryParams: queryParams,
headers: headers,
schema: schema,
method: method,
body: body)
}
}
4 changes: 4 additions & 0 deletions Tests/PostgRESTTests/BuildURLRequestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ final class BuildURLRequestTests: XCTestCase {
.insert(values: ["email": "[email protected]"])
.buildURLRequest(head: false, count: nil)
},
TestCase(name: "call rpc") { client in
try client.rpc(fn: "test_fcn", parameters: ["KEY": "VALUE"])
.buildURLRequest(head: false, count: nil)
}
]

for testCase in testCases {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl \
--request POST \
--data "{\"KEY\":\"VALUE\"}" \
"https://example.supabase.co/rpc/test_fcn"