Don’t throw an RPC Error when no params
key is specified
This commit is contained in:
parent
7f84504170
commit
1becd3ab55
1 changed files with 2 additions and 1 deletions
|
@ -16,6 +16,7 @@ use std::collections::BTreeMap;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use surrealdb::channel;
|
use surrealdb::channel;
|
||||||
use surrealdb::channel::Sender;
|
use surrealdb::channel::Sender;
|
||||||
|
use surrealdb::sql::Array;
|
||||||
use surrealdb::sql::Object;
|
use surrealdb::sql::Object;
|
||||||
use surrealdb::sql::Strand;
|
use surrealdb::sql::Strand;
|
||||||
use surrealdb::sql::Value;
|
use surrealdb::sql::Value;
|
||||||
|
@ -145,7 +146,7 @@ impl Rpc {
|
||||||
// Fetch the 'params' argument
|
// Fetch the 'params' argument
|
||||||
let params = match req.pick(&*PARAMS) {
|
let params = match req.pick(&*PARAMS) {
|
||||||
Value::Array(v) => v,
|
Value::Array(v) => v,
|
||||||
_ => return Response::failure(id, Failure::INVALID_REQUEST).send(chn).await,
|
_ => Array::new(),
|
||||||
};
|
};
|
||||||
// Match the method to a function
|
// Match the method to a function
|
||||||
let res = match &method[..] {
|
let res = match &method[..] {
|
||||||
|
|
Loading…
Reference in a new issue