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

feat(pmp): edit repository in settings - backend #230

Merged
merged 1 commit into from
May 20, 2020

Conversation

ABartoszko
Copy link
Contributor

refs #107

@Sikora00 Sikora00 closed this May 1, 2020
@Sikora00 Sikora00 reopened this May 1, 2020
async execute(command: EditRepositoryCommand): Promise<void> {
const { repositoryId, maxLines, maxWaitingTime } = command;

const repositoryData = await this.repositoryRepository.getById(repositoryId);
Copy link
Contributor

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;
Copy link
Contributor

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;
  ...
}

@ABartoszko ABartoszko force-pushed the feature/PMP-107-2 branch 2 times, most recently from 68e49cb to c0bfbcf Compare May 7, 2020 09:45
@ABartoszko ABartoszko requested a review from Sikora00 May 7, 2020 10:16
@@ -0,0 +1,4 @@
export interface RepositoryEditWriteModel {
maxLines: number;
Copy link
Contributor

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?

Copy link
Contributor

@MaciejSikorski MaciejSikorski left a 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?

@ABartoszko ABartoszko force-pushed the feature/PMP-107-2 branch 2 times, most recently from b2dcf79 to 9bd9588 Compare May 20, 2020 11:57
@MaciejSikorski MaciejSikorski merged commit fb826a6 into feature/PMP-107 May 20, 2020
@MaciejSikorski MaciejSikorski deleted the feature/PMP-107-2 branch May 20, 2020 16:19
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.

3 participants