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

Function fetchSessionsCountForDate

app/core/store/modules/levelSessions.js:253–266  ·  view source on GitHub ↗
({ commit, getters }, { date })

Source from the content-addressed store, hash-verified

251 },
252
253 async fetchSessionsCountForDate ({ commit, getters }, { date }) {
254 const exists = getters.getSessionsCountForDate(date)
255 if (exists) {
256 return exists
257 }
258 try {
259 const sessions = await levelSessionsApi.fetchCompletedByDate(date)
260 commit('setSessionsCountForDate', { date, sessions })
261 return sessions
262 } catch (e) {
263 console.error('Error in fetching sessions count for date', e)
264 noty({ text: 'Error in fetching sessions count for date', type: 'error', timeout: 1000 })
265 }
266 },
267
268 async fetchLevelSessionsForCampaignOfRelatedUser ({ commit, state, getters }, { userId, campaignHandle, options = {} }) {
269 commit('initSessionsByCampaignState', campaignHandle)

Callers

nothing calls this directly

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected