-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c86e161
commit b096f44
Showing
3 changed files
with
583 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { DialogEntity } from '../entity/DialogEntity'; | ||
import DialogsRepository from '../../Data/repository/DialogsRepository'; | ||
import { IUseCase } from './base/IUseCase'; | ||
import { GroupDialogEntity } from '../entity/GroupDialogEntity'; | ||
|
||
export class UpdateCurrentDialogInDataSourceUseCase | ||
implements IUseCase<void, DialogEntity> | ||
{ | ||
private dialogRepository: DialogsRepository; | ||
|
||
private updateDialog: GroupDialogEntity; | ||
|
||
constructor( | ||
dialogRepository: DialogsRepository, | ||
updateDialog: GroupDialogEntity, | ||
) { | ||
console.log('CONSTRUCTOR UpdateCurrentDialogInDataSourceUseCase'); | ||
this.dialogRepository = dialogRepository; | ||
this.updateDialog = updateDialog; | ||
} | ||
|
||
async execute(): Promise<DialogEntity> { | ||
console.log('execute UpdateCurrentDialogInDataSourceUseCase'); | ||
const result: DialogEntity = | ||
await this.dialogRepository.updateCurrentDialogInLocalDataSource( | ||
this.updateDialog, | ||
); | ||
|
||
return Promise.resolve(result); | ||
} | ||
} |
Oops, something went wrong.