You've already forked AstralRinth
forked from didirus/AstralRinth
Final push before rewrite
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
use actix_web::{get, web, HttpResponse};
|
||||
use actix_web::{get, post, web, HttpResponse};
|
||||
use handlebars::*;
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct CreatedMod {
|
||||
name: String,
|
||||
description: String,
|
||||
body: String,
|
||||
}
|
||||
|
||||
#[get("createmod")]
|
||||
pub async fn mod_create_get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
||||
@@ -8,5 +16,15 @@ pub async fn mod_create_get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
||||
});
|
||||
let body = hb.render("mod-create", &data).unwrap();
|
||||
|
||||
HttpResponse::Ok().body(body)
|
||||
}
|
||||
|
||||
#[post("createmod")]
|
||||
pub async fn mod_create_post(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
||||
let data = json!({
|
||||
"name": "Handlebars"
|
||||
});
|
||||
let body = hb.render("mod-create", &data).unwrap();
|
||||
|
||||
HttpResponse::Ok().body(body)
|
||||
}
|
||||
Reference in New Issue
Block a user