PrettyPaste: Add Fork and New button

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain
2022-01-16 13:21:15 +05:30
parent 372bbf28d3
commit 449f0c38a9
7 changed files with 80 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ use crate::models::paste_id::PasteId;
#[derive(FromForm)]
pub struct PasteIdForm {
val: String,
content: String,
ext: String,
}
@@ -15,7 +15,7 @@ pub async fn submit(paste: Form<PasteIdForm>) -> Redirect {
let id = PasteId::new(6);
let filename = format!("upload/{id}", id = id);
let content = &paste.val;
let content = &paste.content;
let ext = &paste.ext;
fs::write(&filename, content).expect("Unable to write to the file");