From 300b0c9a3c84be1dab5efb7ea720d381f608ab22 Mon Sep 17 00:00:00 2001 From: baalajimaestro Date: Sun, 7 May 2023 22:33:27 +0530 Subject: [PATCH] Handle a specific case where gitlab token or project id can be wrong Also make BASE_URL an env variable Signed-off-by: baalajimaestro --- src/main.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 28e9766..0bd778b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,7 +23,7 @@ struct Paste { } #[derive(Serialize, Deserialize)] -struct ResponseJSON { +struct GitLabSuccessJSON { file_name: String, file_path: String, size: u64, @@ -37,23 +37,35 @@ struct ResponseJSON { content: String, } +#[derive(Serialize, Deserialize)] +struct GitLabFailedJSON { + message: String, +} + #[get("/")] async fn paste_render(data: Data