Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 0f72438c authored by rafliesa's avatar rafliesa
Browse files

Implement list function in Notification controller.

parent 0166b3b4
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,6 @@ 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.
Please register or to comment