forked from SteamWar/SteamWar
Fixes
This commit is contained in:
@@ -50,8 +50,8 @@ data class ResponseSchematicLong(val members: List<ResponseUser>, val path: Stri
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class ResponseSchematicList(val breadcrumbs: List<ResponseBreadcrumb>, val schematics: List<ResponseSchematic>, val players: Map<Int, ResponseUser>) {
|
||||
constructor(schematics: List<ResponseSchematic>, breadcrumbs: List<ResponseBreadcrumb>) : this(breadcrumbs, schematics, schematics.map { it.owner }.distinct().map { ResponseUser.get(it) }.associateBy { it.id })
|
||||
data class ResponseSchematicList(val breadcrumbs: List<ResponseBreadcrumb>, val schematics: List<ResponseSchematic>, val players: Map<String, ResponseUser>) {
|
||||
constructor(schematics: List<ResponseSchematic>, breadcrumbs: List<ResponseBreadcrumb>) : this(breadcrumbs, schematics, schematics.map { it.owner }.distinct().map { ResponseUser.get(it) }.associateBy { it.uuid })
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@@ -132,7 +132,7 @@ fun Route.configureSchematic() {
|
||||
}
|
||||
route("/schem") {
|
||||
install(SWPermissionCheck)
|
||||
get {
|
||||
/*get {
|
||||
val user = call.principal<SWAuthPrincipal>()!!.user
|
||||
call.respond(ResponseSchematicList(SchematicNode.list(user, null).filter { it.name != "//copy" }.sortedWith { o1, o2 ->
|
||||
if (o1.isDir || o2.isDir) {
|
||||
@@ -141,7 +141,7 @@ fun Route.configureSchematic() {
|
||||
o1.name.compareTo(o2.name)
|
||||
}
|
||||
}.map { ResponseSchematic(it) }, listOf()))
|
||||
}
|
||||
}*/
|
||||
|
||||
post {
|
||||
val file = call.receive<UploadSchematic>()
|
||||
@@ -166,7 +166,7 @@ fun Route.configureSchematic() {
|
||||
|
||||
call.respond(ResponseSchematic(node))
|
||||
}
|
||||
|
||||
/*
|
||||
route("/{id}") {
|
||||
get {
|
||||
val user = call.principal<SWAuthPrincipal>()!!.user
|
||||
@@ -224,6 +224,6 @@ fun Route.configureSchematic() {
|
||||
}
|
||||
}.map { ResponseSchematic(it) }, parent.generateBreadcrumbsMap(user).map { ResponseBreadcrumb(it.key, it.value) }))
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user