rustploy 0.1.20

Rustploy PaaS daemon — lightweight self-hosted deployment platform
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! `Command::ProjectCreate`: cria um projeto.

use crate::bootstrap::state::AppState;
use shared::Response as RpResponse;

pub async fn handle(state: AppState, name: String, description: Option<String>) -> RpResponse {
    match crate::store::projects::create(&state.db, name, description).await {
        Ok(p) => RpResponse::Project(Box::new(p)),
        Err(e) => RpResponse::err(
            "DatabaseError",
            crate::platform::errors::humanize_db_error(&e, "projeto"),
        ),
    }
}