mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 17:57:10 +00:00
22 lines
483 B
Python
22 lines
483 B
Python
from http import HTTPStatus as status
|
|
|
|
from ninja import Router
|
|
|
|
from api.v1.achievement.schemas import AchievementSchema
|
|
from api.v1.schemas import UnauthorizedError
|
|
from apps.achievement.models import Achievement
|
|
|
|
router = Router(tags=["achievement"])
|
|
|
|
|
|
@router.get(
|
|
"all",
|
|
response={
|
|
status.OK: list[AchievementSchema],
|
|
status.UNAUTHORIZED: UnauthorizedError,
|
|
},
|
|
auth=None,
|
|
)
|
|
def get_all_achievements(request):
|
|
return Achievement.objects.all()
|