Change update_file_name to expect a metadata response

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent b402fab697
commit 6929a88c92

@ -1,6 +1,6 @@
[package]
name = "mediarepo-api"
version = "0.4.0"
version = "0.4.1"
edition = "2018"
license = "gpl-3"

@ -84,10 +84,12 @@ impl FileApi {
/// Updates a files name
#[tracing::instrument(level = "debug", skip(self))]
pub async fn update_file_name(&self, file_id: FileIdentifier, name: String) -> ApiResult<()> {
self.emit("update_file_name", UpdateFileNameRequest { file_id, name })
.await?;
Ok(())
pub async fn update_file_name(
&self,
file_id: FileIdentifier,
name: String,
) -> ApiResult<FileMetadataResponse> {
self.emit_and_get("update_file_name", UpdateFileNameRequest { file_id, name })
.await
}
}

Loading…
Cancel
Save