Skip to content

#107 validate position name#110

Open
AshrakatAbdELSattar wants to merge 4 commits intomainfrom
#107_validate_position_name
Open

#107 validate position name#110
AshrakatAbdELSattar wants to merge 4 commits intomainfrom
#107_validate_position_name

Conversation

@AshrakatAbdELSattar
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@hossamgomaa24 hossamgomaa24 left a comment

Choose a reason for hiding this comment

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

method "update" update the name without validation

}

public ResponseEntity<?> save(PositionDto dto) {
Optional<Position> positionByName = positionService.getByName(dto.getName());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is exictedName better or positionByName?

Copy link
Copy Markdown
Contributor

@Noorhan-Khaled Noorhan-Khaled left a comment

Choose a reason for hiding this comment

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

Where is validation in update?

}

public ResponseEntity<?> save(PositionDto dto) {
Optional<Position> existingPositionName = positionService.getByName(dto.getName());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ليه بتضيفى position احنا موجودين فى positionHandler يبقى هيكون exsistesdName لانه كده معروف انه name ده بتاع position

public ResponseEntity<?> update(Integer id, PositionDto dto){
Position position = positionService.getById(id).
orElseThrow(() -> new ResourceNotFoundException(Position.class.getSimpleName(), id));
Optional<Position> existingPositionName = positionService.getByName(dto.getName());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the same here

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