chore (backend-rs): in the current implementation we need to call to_string() anyway
There's room for refactoring
This commit is contained in:
parent
137d0fe3e5
commit
574d3b3fe5
1 changed files with 2 additions and 5 deletions
|
@ -4,7 +4,7 @@ use crate::util::id::get_timestamp;
|
|||
use redis::{streams::StreamMaxlen, Commands};
|
||||
|
||||
#[crate::export]
|
||||
pub fn add_note_to_antenna(antenna_id: &str, note_id: &str) -> Result<(), Error> {
|
||||
pub fn add_note_to_antenna(antenna_id: String, note_id: &str) -> Result<(), Error> {
|
||||
redis_conn()?.xadd_maxlen(
|
||||
redis_key(format!("antennaTimeline:{}", antenna_id)),
|
||||
StreamMaxlen::Approx(200),
|
||||
|
@ -12,11 +12,8 @@ pub fn add_note_to_antenna(antenna_id: &str, note_id: &str) -> Result<(), Error>
|
|||
&[("note", note_id)],
|
||||
)?;
|
||||
|
||||
let stream = Stream::Antenna {
|
||||
antenna_id: antenna_id.to_string(),
|
||||
};
|
||||
publish_to_stream(
|
||||
&stream,
|
||||
&Stream::Antenna { antenna_id },
|
||||
Some("note"),
|
||||
Some(format!("{{ \"id\": \"{}\" }}", note_id)),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue