diff --git a/src/main/kotlin/su/coolpeople/model/ProfileRepository.kt b/src/main/kotlin/su/coolpeople/model/ProfileRepository.kt index e97e96c..3fbe2ec 100644 --- a/src/main/kotlin/su/coolpeople/model/ProfileRepository.kt +++ b/src/main/kotlin/su/coolpeople/model/ProfileRepository.kt @@ -12,11 +12,11 @@ object ProfileRepository { ), ) - fun getById(id: UInt): Profile? { + fun get(id: UInt): Profile? { return profiles.get(id) } - fun deleteById(id: UInt): Boolean { + fun delete(id: UInt): Boolean { return profiles.remove(id) != null } } diff --git a/src/main/kotlin/su/coolpeople/plugins/Routing.kt b/src/main/kotlin/su/coolpeople/plugins/Routing.kt index 8441088..d992ded 100644 --- a/src/main/kotlin/su/coolpeople/plugins/Routing.kt +++ b/src/main/kotlin/su/coolpeople/plugins/Routing.kt @@ -22,7 +22,7 @@ fun Application.configureRouting() { return@get } - val profile = ProfileRepository.getById(id) + val profile = ProfileRepository.get(id) if (profile == null) { call.respond(HttpStatusCode.NotFound) return@get @@ -39,7 +39,7 @@ fun Application.configureRouting() { return@delete } - if (!ProfileRepository.deleteById(id)) { + if (!ProfileRepository.delete(id)) { call.respond(HttpStatusCode.NotFound) } else { call.respond(HttpStatusCode.OK)