From cdc0cc775b1d136aa5bfcd68d9e8c839ad85c83f Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Fri, 13 Sep 2024 18:25:05 -0700 Subject: [PATCH] GormService accepts an id for delete --- .../grails/plugin/scaffolding/RestfulServiceController.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/grails/plugin/scaffolding/RestfulServiceController.groovy b/src/main/groovy/grails/plugin/scaffolding/RestfulServiceController.groovy index 263b350..b0e814d 100644 --- a/src/main/groovy/grails/plugin/scaffolding/RestfulServiceController.groovy +++ b/src/main/groovy/grails/plugin/scaffolding/RestfulServiceController.groovy @@ -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 @@ -38,6 +39,6 @@ class RestfulServiceController extends RestfulController { } protected void deleteResource(T resource) { - getService().delete(resource) + getService().delete(((GormEntityApi) resource).ident()) } } \ No newline at end of file