Implement ability to add login bonus things in webui
This commit is contained in:
@ -83,6 +83,19 @@ pub fn user(req: HttpRequest) -> HttpResponse {
|
||||
.body(json::stringify(resp))
|
||||
}
|
||||
|
||||
pub fn start_loginbonus(req: HttpRequest, body: String) -> HttpResponse {
|
||||
let token = get_login_token(&req);
|
||||
if token.is_none() {
|
||||
return error("Not logged in");
|
||||
}
|
||||
let body = json::parse(&body).unwrap();
|
||||
let resp = userdata::webui_start_loginbonus(body["bonus_id"].as_i64().unwrap(), &token.unwrap());
|
||||
|
||||
HttpResponse::Ok()
|
||||
.insert_header(ContentType::json())
|
||||
.body(json::stringify(resp))
|
||||
}
|
||||
|
||||
pub fn logout(req: HttpRequest) -> HttpResponse {
|
||||
let token = get_login_token(&req);
|
||||
if !token.is_none() {
|
||||
|
Reference in New Issue
Block a user