Skip to content

added update group handler#19

Merged
petrCher merged 2 commits into
mainfrom
update_group_handler
May 3, 2026
Merged

added update group handler#19
petrCher merged 2 commits into
mainfrom
update_group_handler

Conversation

@rifcrat
Copy link
Copy Markdown
Contributor

@rifcrat rifcrat commented May 3, 2026

Изменения

Написана ручка update group
Closes #14

Детали реализации

В файле modal_backend\utils\services.py написана логика
В файле modal_backend\routes\groups.py написана сама ручка
Новых схем не писал, только метод класса в services.py

Check-List

  • Вы проверили свой код перед отправкой запроса?
  • Вы написали тесты к реализованным функциям?
  • Вы не забыли применить форматирование black и isort для Back-End или Prettier для Front-End?

@rifcrat rifcrat requested a review from petrCher May 3, 2026 19:20
@rifcrat rifcrat self-assigned this May 3, 2026
Comment thread modal_backend/utils/services.py Outdated

@classmethod
async def update_group(cls, db: Session, id: int, group_info: GroupPost):
group = Group.get(session=db.session, id=id)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

здесь можно просто сделать гет запрос, без присвоения результата в переменную

Comment thread modal_backend/utils/services.py Outdated
@classmethod
async def update_group(cls, db: Session, id: int, group_info: GroupPost):
group = Group.get(session=db.session, id=id)
updated_group = Group.update(group.id, session=db.session, **group_info.model_dump())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а здесь соответственно айдишник передавать не group.id а просто id из аргументов самой функции, ты же уже все равно проверил что этот айди валиден

@petrCher petrCher merged commit a5957ba into main May 3, 2026
1 of 2 checks passed
@petrCher petrCher deleted the update_group_handler branch May 3, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

новая ручка update group/{id}

2 participants