Fix territory edits (#2403)
This commit is contained in:
parent
44992fd1bf
commit
7a7ed1745c
@ -14,7 +14,7 @@ export const paymentMethods = [
|
|||||||
|
|
||||||
export async function getCost ({ billingType, uploadIds }, { models, me }) {
|
export async function getCost ({ billingType, uploadIds }, { models, me }) {
|
||||||
const { totalFees } = await uploadFees(uploadIds, { models, me })
|
const { totalFees } = await uploadFees(uploadIds, { models, me })
|
||||||
return satsToMsats(TERRITORY_PERIOD_COST(billingType) + totalFees)
|
return satsToMsats(BigInt(TERRITORY_PERIOD_COST(billingType)) + totalFees)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function perform ({ invoiceId, ...data }, { me, cost, tx }) {
|
export async function perform ({ invoiceId, ...data }, { me, cost, tx }) {
|
||||||
|
@ -66,9 +66,9 @@ export async function uploadFees (s3Keys, { models, me }) {
|
|||||||
nUnpaid,
|
nUnpaid,
|
||||||
uploadFeesMsats
|
uploadFeesMsats
|
||||||
}] = await models.$queryRaw`SELECT * FROM upload_fees(${me?.id ?? USER_ID.anon}::INTEGER, ${s3Keys}::INTEGER[])`
|
}] = await models.$queryRaw`SELECT * FROM upload_fees(${me?.id ?? USER_ID.anon}::INTEGER, ${s3Keys}::INTEGER[])`
|
||||||
const uploadFees = msatsToSats(uploadFeesMsats)
|
const uploadFees = BigInt(msatsToSats(uploadFeesMsats))
|
||||||
const totalFeesMsats = BigInt(nUnpaid) * uploadFeesMsats
|
const totalFeesMsats = BigInt(nUnpaid) * uploadFeesMsats
|
||||||
const totalFees = msatsToSats(totalFeesMsats)
|
const totalFees = BigInt(msatsToSats(totalFeesMsats))
|
||||||
return { bytes24h, bytesUnpaid, nUnpaid, uploadFees, totalFees, totalFeesMsats }
|
return { bytes24h, bytesUnpaid, nUnpaid, uploadFees, totalFees, totalFeesMsats }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user