Skip to content

Commit

Permalink
refactor(backend): use IlpQuoteDetails model directly in ilp payment …
Browse files Browse the repository at this point in the history
…method
  • Loading branch information
BlairCurrey committed Oct 23, 2024
1 parent bb9d334 commit b0897d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/backend/src/payment-method/ilp/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '../handler/errors'
import { TelemetryService } from '../../telemetry/service'
import { IlpQuoteDetailsService } from './quote-details/service'
import { IlpQuoteDetails } from './quote-details/model'

export interface IlpPaymentService extends PaymentMethodService {}

Expand Down Expand Up @@ -218,8 +219,11 @@ async function pay(
}

if (!outgoingPayment.quote.ilpQuoteDetails) {
outgoingPayment.quote.ilpQuoteDetails =
await deps.ilpQuoteDetailsService.getByQuoteId(outgoingPayment.quote.id)
outgoingPayment.quote.ilpQuoteDetails = await IlpQuoteDetails.query(
deps.knex
)
.where('quoteId', outgoingPayment.quote.id)
.first()

if (!outgoingPayment.quote.ilpQuoteDetails) {
throw new PaymentMethodHandlerError(
Expand Down

0 comments on commit b0897d9

Please sign in to comment.