Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 92720201 authored by dzak27567's avatar dzak27567
Browse files

Implement list function in Notification controller.

parent ec97c595
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ pub fn route_stage() -> AdHoc {
return AdHoc::on_ignite("Initializing controller routes...", |rocket| async {
rocket
.mount("/", routes![notification::subscribe, notification::unsubscribe,
notification::receive])
notification::receive, notification::list])
});
}
......@@ -27,4 +27,12 @@ pub fn receive(notification: Json<Notification>) -> Result<Json<Notification>> {
Ok(f) => Ok(Json::from(f)),
Err(e) => Err(e)
};
}
#[get("/")]
pub fn list() -> Result<Json<Vec<String>>> {
return match NotificationService::list_messages() {
Ok(f) => Ok(Json::from(f)),
Err(e) => Err(e)
};
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment