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

Method trackActivity

app/models/User.js:644–655  ·  view source on GitHub ↗
(activityName, increment = 1)

Source from the content-addressed store, hash-verified

642 }
643
644 trackActivity (activityName, increment = 1) {
645 return $.ajax({
646 method: 'POST',
647 url: `/db/user/${this.id}/track/${activityName}/${increment}`,
648 success: attributes => {
649 return this.set(attributes)
650 },
651 error () {
652 return console.error(`Couldn't save activity ${activityName}`)
653 },
654 })
655 }
656
657 /**
658 * Pure read — local cache first, then me.activity. Never writes.

Callers 2

markActivitySeenMethod · 0.95
trackProductVisitFunction · 0.80

Calls 1

setMethod · 0.45

Tested by

no test coverage detected