Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 90d769c9 authored by lantry-glitch's avatar lantry-glitch
Browse files

Implement list function in Notification controller.

parent 16ffffa4
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,8 @@ 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])
});
......
......@@ -30,3 +30,12 @@ pub fn receive(notification: Json<Notification>) -> Result<Json<Notification>> {
};
}
#[get("/")]
pub fn list() -> Result<Json<Vec<String>>> {
return match NotificationService::list_messages() {
Ok(f) => Ok(Json::from(f)),
Err(e) => Err(e)
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment