routes#




Functions#

get_breakdown

Return the first one of these to be found (prioritized in this order):

get_first_breakdown

submit_breakdown

Submit a breakdown on behalf of a user.

get_breakdown()#

rootski.main.endpoints.breakdown.routes.get_breakdown(word_id: int, user: rootski.schemas.user.User = Depends(get_current_user), db: sqlalchemy.orm.session.Session = Depends(get_session))[source]#

Return the first one of these to be found (prioritized in this order):

  1. A verified breakdown

  2. The breakdown last submitted by the requesting user

  3. The inferenced breakdown

  4. The default, unverified breakdown

If this request does not have a “Bearer …” Authorization header, the user is assumed to be anonymous.

get_first_breakdown()#

rootski.main.endpoints.breakdown.routes.get_first_breakdown(breakdowns: List[rootski.services.database.models.models.Breakdown], user_email: str) Optional[rootski.schemas.breakdown.Breakdown][source]#

submit_breakdown()#

rootski.main.endpoints.breakdown.routes.submit_breakdown(payload: rootski.schemas.breakdown.BreakdownUpsert = Body(Ellipsis), user: rootski.schemas.user.User = Depends(get_current_user), db: sqlalchemy.orm.session.Session = Depends(get_session))[source]#

Submit a breakdown on behalf of a user.

Case: If the breakdown is not valid, an error is returned. Case: If the user has already submitted a breakdown for this same word before, the previously submitted breakdown is replaced for that user. Case: If the user is an admin user, the breakdown is marked as “verified”. Otherwise it is unverified.