From 8b5cc0c56535defea1d8e2223ecfeba17dad649a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amalie=20Mans=C3=A5ker?= Date: Mon, 7 Aug 2023 10:32:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/kotlin/no/nav/helse/sprik/Test.kt | 13 ------------- .../no/nav/helse/sprik/db/FeilmeldingRepository.kt | 2 -- .../kotlin/no/nav/helse/sprik/plugins/Routing.kt | 13 +++++-------- .../kotlin/no/nav/helse/sprik/ApplicationTest.kt | 5 ----- .../kotlin/no/nav/helse/sprik/FeilmeldingTest.kt | 1 - yarn.lock | 4 ---- 6 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 backend/src/main/kotlin/no/nav/helse/sprik/Test.kt delete mode 100644 backend/src/test/kotlin/no/nav/helse/sprik/ApplicationTest.kt delete mode 100644 yarn.lock diff --git a/backend/src/main/kotlin/no/nav/helse/sprik/Test.kt b/backend/src/main/kotlin/no/nav/helse/sprik/Test.kt deleted file mode 100644 index 74cddf2..0000000 --- a/backend/src/main/kotlin/no/nav/helse/sprik/Test.kt +++ /dev/null @@ -1,13 +0,0 @@ -package no.nav.helse.sprik - -import kotlinx.serialization.* - -@Serializable -data class Test ( - var ord: String, - var tall: Int -) { - override fun toString(): String { - return "Test(ord='$ord', tall=$tall)" - } -} \ No newline at end of file diff --git a/backend/src/main/kotlin/no/nav/helse/sprik/db/FeilmeldingRepository.kt b/backend/src/main/kotlin/no/nav/helse/sprik/db/FeilmeldingRepository.kt index 0b7430f..0c4a47a 100644 --- a/backend/src/main/kotlin/no/nav/helse/sprik/db/FeilmeldingRepository.kt +++ b/backend/src/main/kotlin/no/nav/helse/sprik/db/FeilmeldingRepository.kt @@ -16,7 +16,6 @@ import org.jetbrains.exposed.sql.transactions.transaction class FeilmeldingRepository { fun lagre(feilmelding: Feilmelding) { - transaction { FeilmeldingTable.run { insert { @@ -50,7 +49,6 @@ class FeilmeldingRepository { fun hentSokteFeilmeldinger(sokeord: String): List = transaction { val sok = "%${sokeord.lowercase().trim()}%" - FeilmeldingTable.select( (FeilmeldingTable.tittel.lowerCase() like sok) or (FeilmeldingTable.beskrivelse.lowerCase() like sok) diff --git a/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt b/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt index ed1e423..a269af0 100644 --- a/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt +++ b/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt @@ -48,14 +48,6 @@ fun configureRouting(): ApplicationEngine = embeddedServer(CIO, applicationEngin get("/isready"){ call.respondText("READY") } - get("/api/test") { - call.respondText("test") - } - post("/api/nyfeil") { - val feilmelding = call.receive() - feilmeldingRepository.lagre(feilmelding) - call.respond(status = HttpStatusCode.Created, message = "Feilmelding motatt og sendt til database") - } get("/api/hentallefeil"){ val testMelding = feilmeldingRepository.hentAlleFeilmeldinger() call.respond(status = HttpStatusCode.Created, message = testMelding) @@ -66,6 +58,11 @@ fun configureRouting(): ApplicationEngine = embeddedServer(CIO, applicationEngin val sokeresultat = feilmeldingRepository.hentSokteFeilmeldinger(sokestreng) call.respond(status = HttpStatusCode.Created, message = sokeresultat) } + post("/api/nyfeil") { + val feilmelding = call.receive() + feilmeldingRepository.lagre(feilmelding) + call.respond(status = HttpStatusCode.Created, message = "Feilmelding motatt og sendt til database") + } put("/api/oppdaterfeil") { val oppdatertFeilmelding = call.receive() feilmeldingRepository.oppdaterFeilmelding(oppdatertFeilmelding) diff --git a/backend/src/test/kotlin/no/nav/helse/sprik/ApplicationTest.kt b/backend/src/test/kotlin/no/nav/helse/sprik/ApplicationTest.kt deleted file mode 100644 index f9023e6..0000000 --- a/backend/src/test/kotlin/no/nav/helse/sprik/ApplicationTest.kt +++ /dev/null @@ -1,5 +0,0 @@ -package no.nav.helse.sprik - - -class ApplicationTest { -} diff --git a/backend/src/test/kotlin/no/nav/helse/sprik/FeilmeldingTest.kt b/backend/src/test/kotlin/no/nav/helse/sprik/FeilmeldingTest.kt index a3f98da..9325537 100644 --- a/backend/src/test/kotlin/no/nav/helse/sprik/FeilmeldingTest.kt +++ b/backend/src/test/kotlin/no/nav/helse/sprik/FeilmeldingTest.kt @@ -97,7 +97,6 @@ class FeilmeldingTest { } } - @Test fun `Henter alle feilmeldinger i databasen`() { feilmeldingRepository.lagre(feilmelding) diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index fb57ccd..0000000 --- a/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - -