rustploy 0.1.0

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

use crate::api::AppState;
use shared::Response as RpResponse;

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