Remove warnings
This commit is contained in:
parent
7b7a9b0fc2
commit
7ac2e1c208
|
@ -15,7 +15,6 @@ import io.ktor.jackson.jackson
|
|||
import io.ktor.response.respond
|
||||
import io.ktor.routing.route
|
||||
import io.ktor.routing.routing
|
||||
import io.ktor.websocket.WebSockets
|
||||
import org.slf4j.event.Level
|
||||
import java.nio.file.Paths
|
||||
|
||||
|
@ -31,7 +30,7 @@ fun Application.main() {
|
|||
install(ConditionalHeaders)
|
||||
install(Compression)
|
||||
install(DataConversion)
|
||||
install(WebSockets)
|
||||
install(AutoHeadResponse)
|
||||
|
||||
install(StatusPages) {
|
||||
exception<Throwable> {
|
||||
|
|
|
@ -133,7 +133,7 @@ fun Route.overview() {
|
|||
}
|
||||
|
||||
get("/post/{id}") {
|
||||
authenticateOrRedirect(Permission.POST) { user ->
|
||||
authenticateOrRedirect(Permission.POST) {
|
||||
val postId = call.parameters["id"]?.toLongOrNull() ?: return@get
|
||||
val editPost = PostRepository.get(postId) ?: return@get
|
||||
respondMain {
|
||||
|
@ -291,7 +291,7 @@ fun Route.overview() {
|
|||
}
|
||||
|
||||
post("/post/{id}") {
|
||||
authenticateOrRedirect(Permission.POST) { user ->
|
||||
authenticateOrRedirect(Permission.POST) {
|
||||
val postId = call.parameters["id"]?.toLongOrNull() ?: return@post
|
||||
|
||||
var imageUploadName: String? = null
|
||||
|
@ -361,7 +361,7 @@ fun Route.overview() {
|
|||
}
|
||||
|
||||
get("/post/new") {
|
||||
authenticateOrRedirect(Permission.POST) { user ->
|
||||
authenticateOrRedirect(Permission.POST) {
|
||||
respondMain {
|
||||
content {
|
||||
h1 { +"Beitrag erstellen" }
|
||||
|
@ -491,7 +491,7 @@ fun Route.overview() {
|
|||
}
|
||||
|
||||
post("/post/new") {
|
||||
authenticateOrRedirect(Permission.POST) { user ->
|
||||
authenticateOrRedirect(Permission.POST) {
|
||||
var imageUploadName: String? = null
|
||||
|
||||
val params = mutableMapOf<String, String>()
|
||||
|
@ -537,7 +537,7 @@ fun Route.overview() {
|
|||
}
|
||||
|
||||
get("/post/{id}/delete") {
|
||||
authenticateOrRedirect(Permission.POST) { user ->
|
||||
authenticateOrRedirect(Permission.POST) {
|
||||
val postId = call.parameters["id"]?.toLongOrNull() ?: return@get
|
||||
|
||||
PostRepository.delete(postId)
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.kif.backend.prefix
|
|||
fun Route.room() {
|
||||
|
||||
get("/rooms") {
|
||||
authenticateOrRedirect(Permission.ROOM) { user ->
|
||||
authenticateOrRedirect(Permission.ROOM) {
|
||||
val search = call.parameters["search"] ?: ""
|
||||
val list = RoomRepository.all()
|
||||
|
||||
|
@ -106,7 +106,7 @@ fun Route.room() {
|
|||
}
|
||||
|
||||
get("/room/{id}") {
|
||||
authenticateOrRedirect(Permission.ROOM) { user ->
|
||||
authenticateOrRedirect(Permission.ROOM) {
|
||||
val roomId = call.parameters["id"]?.toLongOrNull() ?: return@get
|
||||
val editRoom = RoomRepository.get(roomId) ?: return@get
|
||||
respondMain {
|
||||
|
@ -260,7 +260,7 @@ fun Route.room() {
|
|||
}
|
||||
|
||||
post("/room/{id}") {
|
||||
authenticateOrRedirect(Permission.ROOM) { user ->
|
||||
authenticateOrRedirect(Permission.ROOM) {
|
||||
val roomId = call.parameters["id"]?.toLongOrNull() ?: return@post
|
||||
val params = call.receiveParameters().toMap().mapValues { (_, list) ->
|
||||
list.firstOrNull()
|
||||
|
@ -283,7 +283,7 @@ fun Route.room() {
|
|||
}
|
||||
|
||||
get("/room/new") {
|
||||
authenticateOrRedirect(Permission.ROOM) { user ->
|
||||
authenticateOrRedirect(Permission.ROOM) {
|
||||
respondMain {
|
||||
content {
|
||||
h1 { +"Raum erstellen" }
|
||||
|
@ -430,7 +430,7 @@ fun Route.room() {
|
|||
}
|
||||
|
||||
post("/room/new") {
|
||||
authenticateOrRedirect(Permission.ROOM) { user ->
|
||||
authenticateOrRedirect(Permission.ROOM) {
|
||||
val params = call.receiveParameters().toMap().mapValues { (_, list) ->
|
||||
list.firstOrNull()
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ fun Route.room() {
|
|||
}
|
||||
|
||||
get("/room/{id}/delete") {
|
||||
authenticateOrRedirect(Permission.ROOM) { user ->
|
||||
authenticateOrRedirect(Permission.ROOM) {
|
||||
val roomId = call.parameters["id"]?.toLongOrNull() ?: return@get
|
||||
|
||||
RoomRepository.delete(roomId)
|
||||
|
|
|
@ -83,7 +83,7 @@ fun DIV.colorPicker(color: Color?) {
|
|||
|
||||
fun Route.track() {
|
||||
get("/tracks") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val search = call.parameters["search"] ?: ""
|
||||
val list = TrackRepository.all()
|
||||
respondMain {
|
||||
|
@ -145,7 +145,7 @@ fun Route.track() {
|
|||
}
|
||||
|
||||
get("/track/{id}") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val trackId = call.parameters["id"]?.toLongOrNull() ?: return@get
|
||||
val editTrack = TrackRepository.get(trackId) ?: return@get
|
||||
respondMain {
|
||||
|
@ -192,7 +192,7 @@ fun Route.track() {
|
|||
}
|
||||
|
||||
post("/track/{id}") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val trackId = call.parameters["id"]?.toLongOrNull() ?: return@post
|
||||
val params = call.receiveParameters().toMap().mapValues { (_, list) ->
|
||||
list.firstOrNull()
|
||||
|
@ -212,7 +212,7 @@ fun Route.track() {
|
|||
}
|
||||
|
||||
get("/track/new") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
respondMain {
|
||||
content {
|
||||
h1 { +"Track erstellen" }
|
||||
|
@ -251,7 +251,7 @@ fun Route.track() {
|
|||
}
|
||||
|
||||
post("/track/new") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val params = call.receiveParameters().toMap().mapValues { (_, list) ->
|
||||
list.firstOrNull()
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ fun Route.track() {
|
|||
}
|
||||
|
||||
get("track/{id}/delete") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val trackId = call.parameters["id"]?.toLongOrNull() ?: return@get
|
||||
|
||||
TrackRepository.delete(trackId)
|
||||
|
|
|
@ -26,8 +26,8 @@ import kotlin.collections.component2
|
|||
import kotlin.collections.set
|
||||
|
||||
fun Route.user() {
|
||||
get("/users") { param ->
|
||||
authenticateOrRedirect(Permission.USER) { user ->
|
||||
get("/users") {
|
||||
authenticateOrRedirect(Permission.USER) {
|
||||
val search = call.parameters["search"] ?: ""
|
||||
val list = UserRepository.all()
|
||||
respondMain {
|
||||
|
|
|
@ -25,7 +25,7 @@ private const val separator = "###"
|
|||
|
||||
fun Route.workGroup() {
|
||||
get("workgroups") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val search = call.parameters["search"] ?: ""
|
||||
val list = WorkGroupRepository.all()
|
||||
respondMain {
|
||||
|
@ -146,7 +146,7 @@ fun Route.workGroup() {
|
|||
}
|
||||
|
||||
get("/workgroup/{id}") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val workGroupId = call.parameters["id"]?.toLongOrNull() ?: return@get
|
||||
val editWorkGroup = WorkGroupRepository.get(workGroupId) ?: return@get
|
||||
val tracks = TrackRepository.all()
|
||||
|
@ -532,7 +532,7 @@ fun Route.workGroup() {
|
|||
}
|
||||
|
||||
post("/workgroup/{id}") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val workGroupId = call.parameters["id"]?.toLongOrNull() ?: return@post
|
||||
val params = call.receiveParameters().toMap().mapValues { (_, list) ->
|
||||
list.firstOrNull()
|
||||
|
@ -574,7 +574,7 @@ fun Route.workGroup() {
|
|||
}
|
||||
|
||||
get("/workgroup/new") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val tracks = TrackRepository.all()
|
||||
respondMain {
|
||||
content {
|
||||
|
@ -823,7 +823,7 @@ fun Route.workGroup() {
|
|||
}
|
||||
|
||||
post("/workgroup/new") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val params = call.receiveParameters().toMap().mapValues { (_, list) ->
|
||||
list.firstOrNull()
|
||||
}
|
||||
|
@ -872,7 +872,7 @@ fun Route.workGroup() {
|
|||
}
|
||||
|
||||
get("/workgroup/{id}/delete") {
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) { user ->
|
||||
authenticateOrRedirect(Permission.WORK_GROUP) {
|
||||
val workGroupId = call.parameters["id"]?.toLongOrNull() ?: return@get
|
||||
|
||||
WorkGroupRepository.delete(workGroupId)
|
||||
|
|
Loading…
Reference in a new issue