mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 21:27:10 +00:00
add achievements field to user model
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from http import HTTPStatus as status
|
||||
|
||||
from ninja import Router
|
||||
|
||||
from apps.achievement.models import Achievement
|
||||
from api.v1.achievement.schemas import AchievementSchema
|
||||
from api.v1.schemas import UnauthorizedError
|
||||
|
||||
router = Router()
|
||||
|
||||
|
||||
@router.get(
|
||||
"",
|
||||
response={
|
||||
status.OK: list[AchievementSchema],
|
||||
status.UNAUTHORIZED: UnauthorizedError,
|
||||
}
|
||||
)
|
||||
def get_all_achievements(request):
|
||||
return Achievement.objects.all()
|
||||
Reference in New Issue
Block a user