Skip to content

Commit

Permalink
Re-add missing return value for Postgrest#rpc
Browse files Browse the repository at this point in the history
Signed-off-by: TheRealJan <[email protected]>
  • Loading branch information
jan-tennert committed Oct 12, 2023
1 parent 42350bd commit 8e0ad90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.github.jan.supabase.postgrest.executor.RestRequestExecutor
import io.github.jan.supabase.postgrest.query.Count
import io.github.jan.supabase.postgrest.query.PostgrestFilterBuilder
import io.github.jan.supabase.postgrest.request.RpcRequest
import io.github.jan.supabase.postgrest.result.PostgrestResult
import kotlinx.serialization.json.JsonElement


Expand All @@ -24,15 +25,15 @@ suspend inline fun <reified T : Any> Postgrest.rpc(
head: Boolean = false,
count: Count? = null,
filter: PostgrestFilterBuilder.() -> Unit = {},
) {
): PostgrestResult {
val encodedParameters = if (parameters is JsonElement) parameters else serializer.encodeToJsonElement(parameters)
val rpcRequest = RpcRequest(
head = head,
count = count,
filter = PostgrestFilterBuilder(config.propertyConversionMethod).apply(filter).params,
body = encodedParameters
)
RestRequestExecutor.execute(postgrest = this, path = "rpc/$function", request = rpcRequest)
return RestRequestExecutor.execute(postgrest = this, path = "rpc/$function", request = rpcRequest)
}

/**
Expand All @@ -49,11 +50,11 @@ suspend inline fun Postgrest.rpc(
head: Boolean = false,
count: Count? = null,
filter: PostgrestFilterBuilder.() -> Unit = {}
) {
): PostgrestResult {
val rpcRequest = RpcRequest(
head = head,
count = count,
filter = PostgrestFilterBuilder(config.propertyConversionMethod).apply(filter).params
)
RestRequestExecutor.execute(postgrest = this, path = "rpc/$function", request = rpcRequest)
return RestRequestExecutor.execute(postgrest = this, path = "rpc/$function", request = rpcRequest)
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ org.gradle.parallel=true
org.jetbrains.compose.experimental.uikit.enabled=true
org.jetbrains.compose.experimental.jscanvas.enabled=true

supabase-version = 1.4.1-rc-1
supabase-version = 1.4.1-rc-2

0 comments on commit 8e0ad90

Please sign in to comment.