From 89cd1357f0379e2405ca239743f66fcf02662ec1 Mon Sep 17 00:00:00 2001 From: Raymond Yang Date: Tue, 27 Jun 2023 15:58:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=9C=E4=B8=8A=E6=88=90=E5=93=A1=E7=9A=84?= =?UTF-8?q?=E5=88=AA=E9=99=A4=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ray650128/pcredive/plugins/MemberRouting.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/kotlin/com/ray650128/pcredive/plugins/MemberRouting.kt b/src/main/kotlin/com/ray650128/pcredive/plugins/MemberRouting.kt index 0b0ee36..054c349 100644 --- a/src/main/kotlin/com/ray650128/pcredive/plugins/MemberRouting.kt +++ b/src/main/kotlin/com/ray650128/pcredive/plugins/MemberRouting.kt @@ -64,6 +64,14 @@ fun Application.configureMemberRouting() { MemberService.updateById(id, oldData) call.respond(HttpStatusCode.OK, oldData) } + delete("/{id}") { + val id = call.parameters.getOrFail("id") + if (MemberService.deleteById(id)) { + call.respond(HttpStatusCode.OK) + } else { + call.respond(HttpStatusCode.NotFound) + } + } } } }