-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat(pmp): edit repository in settings - backend #230
Conversation
async execute(command: EditRepositoryCommand): Promise<void> { | ||
const { repositoryId, maxLines, maxWaitingTime } = command; | ||
|
||
const repositoryData = await this.repositoryRepository.getById(repositoryId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, it is just a repository. In opposite to add action where we wanted to execute construct mothod.
|
||
const repositoryData = await this.repositoryRepository.getById(repositoryId); | ||
|
||
const updatedRepository = { ...repositoryData, maxLines, maxWaitingTime } as RepositoryEntity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add edit method in the RepositoryEntity end update properties directly like that:
edit(writeModel: RepositoryEditWriteModel): void {
this.maxLines = writeModel.maxLines;
...
}
68e49cb
to
c0bfbcf
Compare
@@ -0,0 +1,4 @@ | |||
export interface RepositoryEditWriteModel { | |||
maxLines: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't they be optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a spec.ts for edit-repository.handler?
b2dcf79
to
9bd9588
Compare
9bd9588
to
26f5187
Compare
refs #107