Skip to content

OBGM-575 Unable to create product source (fix for update and delete after QA)#4165

Merged
awalkowiak merged 1 commit intofeature/upgrade-to-grails-3.3.10from
OBGM-575-fix
Jul 13, 2023
Merged

OBGM-575 Unable to create product source (fix for update and delete after QA)#4165
awalkowiak merged 1 commit intofeature/upgrade-to-grails-3.3.10from
OBGM-575-fix

Conversation

@alannadolny
Copy link
Collaborator

No description provided.

@awalkowiak awalkowiak merged commit add7c85 into feature/upgrade-to-grails-3.3.10 Jul 13, 2023
@awalkowiak awalkowiak deleted the OBGM-575-fix branch July 13, 2023 15:18
Copy link
Member

@jmiranda jmiranda left a comment

Choose a reason for hiding this comment

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

LGTM


ProductSupplier saveProductSupplier(ProductSupplier productSupplier) {
return productSupplier.save()
if (!productSupplier.hasErrors()) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not just do this

return !productSupplier.hasErrors() && productSupplier.save(flush: true)

return null
}

void deleteProductSupplier(ProductSupplier productSupplier) {
Copy link
Member

Choose a reason for hiding this comment

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

I know for this case we do the lookup in the controller, but I think our service layer should allow a delete by ID. For now, we can add that method when we need it. I just wanted to make sure that I set expectations.

void deleteProductSupplier(String id) {
    ProductSupplier productSupplier = ProductSupplier.get(id)
    productSupplier.delete()
}

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.

5 participants