mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 15:37:10 +00:00
formatted :)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from ninja import ModelSchema, Schema
|
||||
from ninja import ModelSchema
|
||||
|
||||
from apps.achievement.models import Achievement
|
||||
|
||||
@@ -6,4 +6,9 @@ from apps.achievement.models import Achievement
|
||||
class AchievementSchema(ModelSchema):
|
||||
class Meta:
|
||||
model = Achievement
|
||||
fields = ("id", "name", "description", "icon",)
|
||||
fields = (
|
||||
"id",
|
||||
"name",
|
||||
"description",
|
||||
"icon",
|
||||
)
|
||||
|
||||
@@ -2,9 +2,9 @@ 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
|
||||
from apps.achievement.models import Achievement
|
||||
|
||||
router = Router()
|
||||
|
||||
@@ -14,7 +14,7 @@ router = Router()
|
||||
response={
|
||||
status.OK: list[AchievementSchema],
|
||||
status.UNAUTHORIZED: UnauthorizedError,
|
||||
}
|
||||
},
|
||||
)
|
||||
def get_all_achievements(request):
|
||||
return Achievement.objects.all()
|
||||
|
||||
Reference in New Issue
Block a user