AppEndpoint.name is required for both the client and server

This commit is contained in:
Baptiste Gelez 2018-10-23 10:43:14 +01:00
parent 31641b1ea1
commit 0dbf9f519e
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ use canapi::Endpoint;
#[derive(Clone, Default, Serialize, Deserialize)]
pub struct AppEndpoint {
pub id: Option<i32>,
pub name: Option<String>,
pub name: String,
pub website: Option<String>,
pub redirect_uri: Option<String>,
pub client_id: Option<String>,

View File

@ -44,7 +44,7 @@ impl Provider<Connection> 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<Connection> 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,