Add the ability to delete files #82

Merged
savanni merged 3 commits from file-service/delete-file into main 2023-10-26 04:21:34 +00:00
2 changed files with 2 additions and 3 deletions
Showing only changes of commit ce874e1d30 - Show all commits

View File

@ -74,7 +74,7 @@ impl Html for Form {
None => "".to_owned(), None => "".to_owned(),
}; };
format!( format!(
"<form action=\"{path}\" method=\"{method}\" {encoding}\n{elements}\n</form>\n", "<form action=\"{path}\" method=\"{method}\" {encoding}>\n{elements}\n</form>\n",
path = self.path, path = self.path,
method = self.method, method = self.method,
encoding = encoding, encoding = encoding,

View File

@ -106,9 +106,8 @@ pub fn thumbnail(info: &FileInfo) -> Container {
) )
.with_html( .with_html(
Form::new() Form::new()
.with_path(&format!("/{}", *info.id)) .with_path(&format!("/delete/{}", *info.id))
.with_method("post") .with_method("post")
.with_html(Input::new("hidden", "_method").with_value("delete"))
.with_html(Button::new("Delete")), .with_html(Button::new("Delete")),
), ),
) )