Skip to content

Commit

Permalink
Merge pull request #127 from codeconsole/5.1.x-restfulservicecontroll…
Browse files Browse the repository at this point in the history
…er-deletefix

GormService accepts an id for delete
  • Loading branch information
codeconsole authored Sep 14, 2024
2 parents d4d27b7 + cdc0cc7 commit 4070f80
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import grails.artefact.Artefact
import grails.gorm.transactions.ReadOnly
import grails.rest.RestfulController
import grails.util.Holders
import org.grails.datastore.gorm.GormEntityApi

@Artefact("Controller")
@ReadOnly
Expand Down Expand Up @@ -38,6 +39,6 @@ class RestfulServiceController<T> extends RestfulController<T> {
}

protected void deleteResource(T resource) {
getService().delete(resource)
getService().delete(((GormEntityApi) resource).ident())
}
}

0 comments on commit 4070f80

Please sign in to comment.