mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 21:59:00 +02:00
Merge pull request #12816 from overleaf/bg-recurly-scripts-cleanup
sort recurly script JSON outputs for consistency GitOrigin-RevId: e5dc789fd834e9864912e3ef14ac3e6bf8eb7d99
This commit is contained in:
@@ -46,7 +46,7 @@ function computePrices(plan) {
|
||||
unitAmount: parseInt(prices[currency], 10),
|
||||
})
|
||||
}
|
||||
return result
|
||||
return _.sortBy(result, 'currency')
|
||||
}
|
||||
|
||||
// Handle prices for license add-ons associated with group plans
|
||||
@@ -106,7 +106,7 @@ function generate(inputFile, outputFile) {
|
||||
const input = fs.readFileSync(inputFile, 'utf8')
|
||||
const rawRecords = csv.parse(input, { columns: true })
|
||||
// transform the raw records into the output format
|
||||
const plans = rawRecords.map(transformRecordToPlan)
|
||||
const plans = _.sortBy(rawRecords, 'plan_code').map(transformRecordToPlan)
|
||||
const output = JSON.stringify(plans, null, 2)
|
||||
fs.writeFileSync(outputFile, output)
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ async function getRecurlyPlans() {
|
||||
}
|
||||
result.push(plan)
|
||||
}
|
||||
return result
|
||||
return _.sortBy(result, 'code')
|
||||
}
|
||||
|
||||
async function getRecurlyPlanAddOns(plan) {
|
||||
|
||||
Reference in New Issue
Block a user