gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] 02/02: remove bank connection


From: gnunet
Subject: [libeufin] 02/02: remove bank connection
Date: Tue, 30 Jun 2020 16:46:31 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

commit be89bc87d74fd01d78bebb809c022319c322e763
Author: MS <ms@taler.net>
AuthorDate: Tue Jun 30 16:46:23 2020 +0200

    remove bank connection
---
 nexus/src/main/kotlin/tech/libeufin/nexus/server/JSON.kt     |  4 ++++
 .../main/kotlin/tech/libeufin/nexus/server/NexusServer.kt    | 12 ++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/server/JSON.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/server/JSON.kt
index cf9f819..ad695c4 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/JSON.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/JSON.kt
@@ -110,6 +110,10 @@ data class BankConnectionsList(
     val bankConnections: List<BankConnectionInfo>
 )
 
+data class BankConnectionDeletion(
+    val bankConnectionId: String
+)
+
 data class EbicsHostTestRequest(
     val ebicsBaseUrl: String,
     val ebicsHostId: String
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
index f3431b1..29a4fc1 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
@@ -624,6 +624,18 @@ fun serverMain(dbName: String, host: String) {
                 call.respond(object {})
             }
 
+            post("/bank-connections/delete") {
+                val body = call.receive<BankConnectionDeletion>()
+                transaction {
+                    val conn = 
NexusBankConnectionEntity.findById(body.bankConnectionId) ?: throw NexusError(
+                        HttpStatusCode.NotFound,
+                        "Bank connection ${body.bankConnectionId}"
+                    )
+                    conn.delete() // temporary, and instead just _mark_ it as 
deleted?
+                }
+                call.respond(object {})
+            }
+
             get("/bank-connections") {
                 val connList = mutableListOf<BankConnectionInfo>()
                 transaction {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]