From a1fe8e2bd784dcc20b15277f1dc1b1a3513ce4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Wed, 26 Oct 2022 20:20:45 +0200 Subject: [PATCH] feat(spine): Allow deletes to affect sub-routes --- spine/src/commonMain/kotlin/opensavvy.spine/Resource.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spine/src/commonMain/kotlin/opensavvy.spine/Resource.kt b/spine/src/commonMain/kotlin/opensavvy.spine/Resource.kt index 8a9ebfe..f8cc677 100644 --- a/spine/src/commonMain/kotlin/opensavvy.spine/Resource.kt +++ b/spine/src/commonMain/kotlin/opensavvy.spine/Resource.kt @@ -148,11 +148,14 @@ sealed class ResourceGroup { validate(id, it, params, context) } - protected fun delete(validate: OperationValidator = { _, _, _, _ -> }) = + protected fun delete( + route: Route? = null, + validate: OperationValidator = { _, _, _, _ -> }, + ) = Operation( this, Operation.Kind.Delete, - route = null + route = route ) { id: Id, it: In, _: Parameters.Empty, context -> validateCorrectId(id) validateId(id, context) -- 2.51.2