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