rustploy 0.1.71

Rustploy PaaS daemon — lightweight self-hosted deployment platform
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! `Command::ProjectServicesReorder`: ordem de exibição dos serviços de um projeto.

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

pub async fn handle(state: AppState, project_id: String, service_ids: Vec<String>) -> RpResponse {
    match crate::store::services::reorder(&state.db, &project_id, &service_ids).await {
        Ok(Ok(())) => RpResponse::Ok,
        Ok(Err(reason)) => RpResponse::err("InvalidInput", reason),
        Err(e) => RpResponse::err(
            "DatabaseError",
            crate::platform::errors::humanize_db_error(&e, "serviço"),
        ),
    }
}