MCPcopy Create free account
hub / github.com/codecombat/codecombat / makeCoursePrepaid

Method makeCoursePrepaid

app/models/User.js:1165–1176  ·  view source on GitHub ↗
(prepaidId)

Source from the content-addressed store, hash-verified

1163 }
1164
1165 makeCoursePrepaid (prepaidId) {
1166 const courseProduct = _.find(this.get('products'), p => (p.product === 'course') && ((p.prepaid + '') === (prepaidId + '')))
1167 if (!courseProduct) { return null }
1168 const Prepaid = require('models/Prepaid')
1169 return new Prepaid({
1170 _id: prepaidId,
1171 type: 'course',
1172 includedCourseIDs: courseProduct?.productOptions?.includedCourseIDs,
1173 startDate: courseProduct.startDate,
1174 endDate: courseProduct.endDate,
1175 })
1176 }
1177
1178 // TODO: Probably better to denormalize this into the user
1179 getLeadPriority () {

Callers 2

revokeUsersMethod · 0.80

Calls 1

getMethod · 0.95

Tested by

no test coverage detected