routes#
Functions#
Return the first one of these to be found (prioritized in this order): |
|
Submit a breakdown on behalf of a user. |
get_breakdown()
#
- rootski.main.endpoints.breakdown.routes.get_breakdown(request: starlette.requests.Request, word_id: Union[str, int], user: rootski.schemas.user.User = Depends(get_current_user))[source]#
Return the first one of these to be found (prioritized in this order):
A verified breakdown
The breakdown last submitted by the requesting user
The breakdown last submitted by another user
The inferenced breakdown
The breakdown was not found
If this request does not have a “Bearer …” Authorization header, the user is assumed to be anonymous.
get_morphemes_for_breakdown()
#
- rootski.main.endpoints.breakdown.routes.get_morphemes_for_breakdown(user_submitted_breakdown: rootski.schemas.breakdown.BreakdownUpsert, db: rootski.services.database.dynamo.db_service.DBService) Dict[str, rootski.services.database.dynamo.models.morpheme.Morpheme] [source]#
recreate_incorrect_word_from_breakdown_items()
#
recreate_word_from_breakdown_items()
#
submit_breakdown()
#
- rootski.main.endpoints.breakdown.routes.submit_breakdown(request: starlette.requests.Request, payload: rootski.schemas.breakdown.BreakdownUpsert = Body(Ellipsis), user: rootski.schemas.user.User = Depends(get_current_user))[source]#
Submit a breakdown on behalf of a user.
Case: If the breakdown is not valid, an error is returned. Case: If the user is an admin user, the breakdown is marked as “verified”. Otherwise it is unverified. Case: If the user has already submitted a breakdown for this same word before, the previously submitted breakdown is replaced for that user.
NOTE: We assume the word a breakdown is being submitted for always exists.