feat: common style for crud endpoints
This commit is contained in:
@ -24,9 +24,9 @@ class StatusService:
|
||||
)
|
||||
|
||||
async def create_status(self, request: CreateStatusRequest) -> CreateStatusResponse:
|
||||
status = await self.repository.create(request.status)
|
||||
status = await self.repository.create(request.entity)
|
||||
return CreateStatusResponse(
|
||||
status=StatusSchema.model_validate(status),
|
||||
entity=StatusSchema.model_validate(status),
|
||||
message="Статус успешно создан",
|
||||
)
|
||||
|
||||
@ -35,7 +35,7 @@ class StatusService:
|
||||
if not status:
|
||||
raise HTTPException(status_code=404, detail="Статус не найден")
|
||||
|
||||
await self.repository.update(status, request.status)
|
||||
await self.repository.update(status, request.entity)
|
||||
return UpdateBoardResponse(message="Статус успешно обновлен")
|
||||
|
||||
async def delete_status(self, status_id: int) -> DeleteStatusResponse:
|
||||
|
||||
Reference in New Issue
Block a user