From 0dbf9f519e638e2354c8388d6b646a5f1d09bd08 Mon Sep 17 00:00:00 2001 From: Baptiste Gelez Date: Tue, 23 Oct 2018 10:43:14 +0100 Subject: [PATCH] AppEndpoint.name is required for both the client and server --- plume-api/src/apps.rs | 2 +- plume-models/src/apps.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plume-api/src/apps.rs b/plume-api/src/apps.rs index 099511da..5cd8576c 100644 --- a/plume-api/src/apps.rs +++ b/plume-api/src/apps.rs @@ -3,7 +3,7 @@ use canapi::Endpoint; #[derive(Clone, Default, Serialize, Deserialize)] pub struct AppEndpoint { pub id: Option, - pub name: Option, + pub name: String, pub website: Option, pub redirect_uri: Option, pub client_id: Option, diff --git a/plume-models/src/apps.rs b/plume-models/src/apps.rs index 07612c3d..a3446c65 100755 --- a/plume-models/src/apps.rs +++ b/plume-models/src/apps.rs @@ -44,7 +44,7 @@ impl Provider for App { let client_secret = random_hex(); let app = App::insert(conn, NewApp { - name: data.name.expect("App::create: name is required"), + name: data.name, client_id: client_id, client_secret: client_secret, redirect_uri: data.redirect_uri, @@ -53,7 +53,7 @@ impl Provider for App { Ok(AppEndpoint { id: Some(app.id), - name: Some(app.name), + name: app.name, client_id: Some(app.client_id), client_secret: Some(app.client_secret), redirect_uri: app.redirect_uri,