mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-19 22:13:49 +00: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:
parent
46fb6f7c83
commit
c3ad6645fe
2 changed files with 3 additions and 3 deletions
|
@ -46,7 +46,7 @@ function computePrices(plan) {
|
||||||
unitAmount: parseInt(prices[currency], 10),
|
unitAmount: parseInt(prices[currency], 10),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return result
|
return _.sortBy(result, 'currency')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle prices for license add-ons associated with group plans
|
// 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 input = fs.readFileSync(inputFile, 'utf8')
|
||||||
const rawRecords = csv.parse(input, { columns: true })
|
const rawRecords = csv.parse(input, { columns: true })
|
||||||
// transform the raw records into the output format
|
// 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)
|
const output = JSON.stringify(plans, null, 2)
|
||||||
fs.writeFileSync(outputFile, output)
|
fs.writeFileSync(outputFile, output)
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ async function getRecurlyPlans() {
|
||||||
}
|
}
|
||||||
result.push(plan)
|
result.push(plan)
|
||||||
}
|
}
|
||||||
return result
|
return _.sortBy(result, 'code')
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getRecurlyPlanAddOns(plan) {
|
async function getRecurlyPlanAddOns(plan) {
|
||||||
|
|
Loading…
Reference in a new issue