fixed delet function naming

This commit is contained in:
Waradu 2024-10-19 23:03:25 +02:00
parent 04846fc51a
commit 15085a7a09
No known key found for this signature in database
GPG key ID: F85AAC8BA8B8DAAD
4 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View file

@ -1084,7 +1084,7 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
[[package]]
name = "streamshare"
version = "1.1.0"
version = "1.1.1"
dependencies = [
"futures",
"reqwest",

View file

@ -1,6 +1,6 @@
[package]
name = "streamshare"
version = "1.1.0"
version = "1.1.1"
edition = "2021"
description = "Upload to streamshare library"
license = "MIT"

View file

@ -22,7 +22,7 @@ match upload(&file_path).await {
Delete:
```rust
match streamshare::delete(identifier, deltoken).await {
match streamshare::delete(file_identifier deletion_token).await {
Ok(_) => println!("File deleted successfully"),
Err(e) => eprintln!("Error deleting file: {}", e),
}

View file

@ -90,11 +90,11 @@ pub async fn upload(file_path: &str) -> Result<(String, String), Box<dyn std::er
))
}
pub async fn delete(identifier: &str, deltoken: &str) -> Result<(), Box<dyn std::error::Error>> {
pub async fn delete(file_identifier: &str, deletion_token: &str) -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let delete_url = format!(
"https://streamshare.wireway.ch/api/delete/{}/{}",
identifier, deltoken
file_identifier, deletion_token
);
let res = client.delete(&delete_url).send().await?;