find many take 1

This commit is contained in:
boufni95 2024-08-29 22:48:44 +02:00
parent eea31ea42f
commit 227c9ff296

View file

@ -53,9 +53,9 @@ export default class {
}
async GetLatestForwardingIndexOffset() {
const latestIndex = await this.DB.getRepository(ChannelRouting).findOne({ order: { latest_index_offset: "DESC" } })
if (latestIndex) {
return latestIndex.latest_index_offset
const latestIndex = await this.DB.getRepository(ChannelRouting).find({ order: { latest_index_offset: "DESC" }, take: 1 })
if (latestIndex.length > 0) {
return latestIndex[0].latest_index_offset
}
return 0
}