Fixed small issues
This commit is contained in:
@@ -86,7 +86,7 @@ class CollectionItemService(private val connection: Connection) {
|
|||||||
try {
|
try {
|
||||||
val resultSet = statement.executeQuery()
|
val resultSet = statement.executeQuery()
|
||||||
// Only return non-archived books
|
// Only return non-archived books
|
||||||
if (resultSet.next() and !resultSet.getBoolean("is_archived")) {
|
if (resultSet.next() && !resultSet.getBoolean("is_archived")) {
|
||||||
return createItemFromResult(resultSet)
|
return createItemFromResult(resultSet)
|
||||||
} else {
|
} else {
|
||||||
throw DbElementNotFoundException("Could not find collection item. resultSet: $resultSet")
|
throw DbElementNotFoundException("Could not find collection item. resultSet: $resultSet")
|
||||||
@@ -183,6 +183,6 @@ fun createItemFromResult(resultSet: ResultSet): CollectionItem {
|
|||||||
lostDate = lostDate.toString()
|
lostDate = lostDate.toString()
|
||||||
)
|
)
|
||||||
} catch (cause: NullPointerException) {
|
} catch (cause: NullPointerException) {
|
||||||
throw DbElementInsertionException("${cause.message}\nresultSet = ${resultSet.getMetaData()}")
|
throw DbElementInsertionException("${cause.message}\nresultSet = ${resultSet.metaData}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "./endpoints/items.yaml#/components/schemas/CollectionItem"
|
$ref: "#/components/schemas/CollectionItem"
|
||||||
"400":
|
"400":
|
||||||
description: "Bad Request. Something was malformed or missing."
|
description: "Bad Request. Something was malformed or missing."
|
||||||
"404":
|
"404":
|
||||||
|
|||||||
Reference in New Issue
Block a user