Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRY-refactored archive method in ArchivableRepository #676

Merged
merged 6 commits into from
Sep 25, 2024

Conversation

StriderDunedain
Copy link
Contributor

@StriderDunedain StriderDunedain commented Sep 5, 2024

Что сделано?

Немного поправил реализацию метода .archive, стало попроще

Что сейчас?

Жду ревью

@gorskyolga
Copy link
Collaborator

Мне кажется, можно просто удалить метод archive из TaskRepository.

  1. TaskRepository наследуется от ContentRepository, а он в свою очередь от ArchivableRepository. Вместо удаленного метода archive из TaskRepository будет вызываться метод archive из ArchivableRepository.
  2. Методы get и update, используемые в archive из TaskRepository, - это метод get из ArchivableRepository и метод update из AbstractRepository. То есть те же самые, что используются в archive из ArchivableRepository.
  3. Методы archive из TaskRepository и ArchivableRepository отличаются только наличием return в методе из ArchivableRepository. Но мы можем не использовать то, что возвращает метод, если нам это не нужно.

@gorskyolga
Copy link
Collaborator

@Xalgina , Здесь нужно протестировать, что архивация через эндпоинты, осталась корректной:

Copy link

@Xalgina Xalgina left a comment

Choose a reason for hiding this comment

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

Протестировано, ок.

@gorskyolga gorskyolga merged commit c159890 into develop Sep 25, 2024
5 checks passed
@gorskyolga gorskyolga deleted the fix/refactor-archive-method-to-satisfy-dry branch September 25, 2024 09:58
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.

Рефакторинг метода archive
3 participants