Fixed small issues

This commit is contained in:
2025-08-12 22:21:30 -04:00
parent f28d07f0c4
commit 53f5b9aafa
2 changed files with 3 additions and 3 deletions

View File

@@ -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}")
} }
} }

View File

@@ -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":