mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-22 08:16:28 +00:00
include meta in info endpoint
This commit is contained in:
parent
85204776d7
commit
6000553b95
@ -11,7 +11,9 @@ pub struct Note {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct NoteInfo {}
|
pub struct NoteInfo {
|
||||||
|
pub meta: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct NotePublic {
|
pub struct NotePublic {
|
||||||
|
@ -24,7 +24,7 @@ async fn one(path: web::Path<NotePath>) -> impl Responder {
|
|||||||
let note = store::get(&p.id);
|
let note = store::get(&p.id);
|
||||||
|
|
||||||
match note {
|
match note {
|
||||||
Ok(Some(_)) => HttpResponse::Ok().json(NoteInfo {}),
|
Ok(Some(n)) => HttpResponse::Ok().json(NoteInfo { meta: n.meta }),
|
||||||
Ok(None) => HttpResponse::NotFound().finish(),
|
Ok(None) => HttpResponse::NotFound().finish(),
|
||||||
Err(e) => HttpResponse::InternalServerError().body(e.to_string()),
|
Err(e) => HttpResponse::InternalServerError().body(e.to_string()),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user