Compare commits

..

No commits in common. "eb56af74e6a4914884a98a449c2afcc176bc0e13" and "99d760729409c19f852ba694b32f0a422d37a0ca" have entirely different histories.

2 changed files with 10 additions and 6 deletions

View file

@ -1,9 +1,10 @@
use crate::AppState;
use actix_web::{error::ErrorInternalServerError, web, HttpResponse, Responder};
use std::os::linux::raw::stat;
use actix_web::{error::ErrorInternalServerError, http::header::ACCEPT, web, HttpResponse, Responder};
use entity::node_group;
use sea_orm::{ActiveModelTrait, ActiveValue, EntityTrait};
use sea_orm::{ActiveModelTrait, ActiveValue, EntityTrait, IntoActiveModel};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::AppState;
#[derive(Deserialize)]
pub struct CreateGroupWithoutId {
@ -112,4 +113,4 @@ pub async fn delete_node(
.map_err(ErrorInternalServerError)?;
Ok(HttpResponse::Ok().finish())
}
}

View file

@ -1,5 +1,5 @@
use crate::controller::{node, user};
use actix_web::web::{self};
use actix_web::web::{self, route, service};
pub fn config(cfg: &mut web::ServiceConfig) {
cfg.service(
@ -19,7 +19,10 @@ pub fn config(cfg: &mut web::ServiceConfig) {
.get(node::get_nodes)
.post(node::create_node),
)
.service(web::resource("/nodes/{id}").delete(node::delete_node))
.service(
web::resource("/nodes/{id}")
.delete(node::delete_node)
)
.service(web::resource("/groups").post(node::create_group)),
);
}