pub fn get_sessions(
db: &Database,
auth: &Auth,
info: &PaginationParams,
) -> Result<UserSessionResponse, (u16, &'static str)>
Expand description
/sessions
queries db
for all sessions owned by the User
associated with auth
breaks up the results of that query as defined by info
§Returns Result
- Ok(
UserSessionResponse
)- the results of the query paginated according to
info
- the results of the query paginated according to
- Err([
StatusCode
], [Message
])
§Errors
- 500: Could not fetch sessions
§Panics
- could not connect to database
TODO: don’t panic if db connection fails, just return an error