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

NOISSUE - Fix ViewGroup and UpdateGroup #1269

Merged
merged 5 commits into from
Oct 27, 2020
Merged

NOISSUE - Fix ViewGroup and UpdateGroup #1269

merged 5 commits into from
Oct 27, 2020

Conversation

manuio
Copy link
Contributor

@manuio manuio commented Oct 26, 2020

Signed-off-by: Manuel Imperiale manuel.imperiale@gmail.com

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
@manuio manuio requested a review from a team as a code owner October 26, 2020 09:59
@@ -129,6 +129,7 @@ func (req createGroupReq) validate() error {

type updateGroupReq struct {
token string
id string
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

we need parent id here also

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Comment on lines 143 to 151
if req.id == "" {
return users.ErrMalformedEntity
}
if req.Name == "" {
return users.ErrMalformedEntity
}
if len(req.Name) > maxNameSize {
return users.ErrMalformedEntity
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can or these conditions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I meant that you can or all of these checks: if id == "" || name == "" || len(name) > maxNameLen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agreed to group this checks by type but for consistency with other services and readability I would keep it like that.
You can check here: https://github.com/mainflux/mainflux/blob/master/things/api/things/http/requests.go

}

group := users.Group{
Name: req.Name,
Copy link
Contributor

Choose a reason for hiding this comment

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

mising ID

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
mteodor
mteodor previously approved these changes Oct 26, 2020
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

OK for me, just take into account @dusanb94 's remark and I'll approve

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

LGTM

@drasko drasko merged commit 926e979 into absmach:master Oct 27, 2020
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.

4 participants