This commit is contained in:
@@ -85,11 +85,11 @@ pub async fn get_id_by_token(token: &str) -> Result<String, Box<dyn Error>> {
|
||||
pub async fn user_added_file(
|
||||
redis: &mut MultiplexedConnection,
|
||||
user_id: &str,
|
||||
file_key: &str,
|
||||
filename: &str,
|
||||
) -> Result<(), actix_web::Error> {
|
||||
redis
|
||||
.sadd::<&str, &str, ()>(user_id, file_key)
|
||||
.sadd::<&str, &str, ()>(user_id, filename)
|
||||
.await
|
||||
.map_err(|_| ErrorInternalServerError("Failed to save file_key in Redis"))?; // Добавляем имя файла в набор пользователя
|
||||
.map_err(|_| ErrorInternalServerError(format!("Failed to save {} in Redis", filename)))?; // Добавляем имя файла в набор пользователя
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user