Allow sending Table
type for LIVE
query RPC method
This commit is contained in:
parent
0e8866b4e3
commit
454612487a
2 changed files with 5 additions and 0 deletions
|
@ -666,6 +666,10 @@ impl Value {
|
|||
matches!(self, Value::Range(_))
|
||||
}
|
||||
|
||||
pub fn is_table(&self) -> bool {
|
||||
matches!(self, Value::Table(_))
|
||||
}
|
||||
|
||||
pub fn is_strand(&self) -> bool {
|
||||
matches!(self, Value::Strand(_))
|
||||
}
|
||||
|
|
|
@ -263,6 +263,7 @@ impl Rpc {
|
|||
},
|
||||
// Setup a live query on a specific table
|
||||
"live" => match params.needs_one() {
|
||||
Ok(v) if v.is_table() => rpc.read().await.live(v).await,
|
||||
Ok(v) if v.is_strand() => rpc.read().await.live(v).await,
|
||||
_ => return res::failure(id, Failure::INVALID_PARAMS).send(out, chn).await,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue