Skip to content

Commit

Permalink
fix breaking changes and lints
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed Nov 19, 2024
1 parent b3e9daa commit b8d01b9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class SeqSetCitationsDatabaseService(
.insert {
it[SeqSetRecordsTable.accession] = record.accession
it[SeqSetRecordsTable.type] = record.type
it[SeqSetRecordsTable.isFocal] = record.isFocal ?: true
it[SeqSetRecordsTable.isFocal] = record.isFocal
}
SeqSetToRecordsTable
.insert {
Expand Down Expand Up @@ -119,6 +119,7 @@ class SeqSetCitationsDatabaseService(
.where { SeqSetsTable.seqSetId eq seqSetId and (SeqSetsTable.createdBy eq username) }
.firstOrNull()
?.get(SeqSetsTable.seqSetVersion.max())
as Long?

if (maxVersion == null) {
throw NotFoundException("SeqSet $seqSetId does not exist")
Expand Down Expand Up @@ -158,7 +159,7 @@ class SeqSetCitationsDatabaseService(
.insert {
it[SeqSetRecordsTable.accession] = record.accession
it[SeqSetRecordsTable.type] = record.type
it[SeqSetRecordsTable.isFocal] = record.isFocal ?: true
it[SeqSetRecordsTable.isFocal] = record.isFocal
}
insertedRecord[SeqSetRecordsTable.seqSetRecordId]
} else {
Expand Down Expand Up @@ -469,7 +470,7 @@ class SeqSetCitationsDatabaseService(
val (accession, version) = it.accession.split('.')
AccessionVersion(accession, version.toLong())
}
} catch (e: NumberFormatException) {
} catch (_: NumberFormatException) {
throw UnprocessableEntityException("Accession versions must be integers")
}

Expand Down

0 comments on commit b8d01b9

Please sign in to comment.