MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / current

Function current

examples/react_admin/backend/src/controllers/user.rs:7–10  ·  view source on GitHub ↗
(auth: auth::JWT, State(ctx): State<AppContext>)

Source from the content-addressed store, hash-verified

5
6#[debug_handler]
7async fn current(auth: auth::JWT, State(ctx): State<AppContext>) -> Result<Response> {
8 let user = users::Model::find_by_pid(&ctx.db, &auth.claims.pid).await?;
9 format::json(CurrentResponse::new(&user))
10}
11
12pub fn routes() -> Routes {
13 Routes::new().prefix("user").add("/current", get(current))

Callers

nothing calls this directly

Calls 2

jsonFunction · 0.85
newFunction · 0.50

Tested by

no test coverage detected