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

Function searchUser

app/core/api/admin.js:20–44  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

18 },
19
20 searchUser (query) {
21 let permissions, q
22 let role
23 if (typeof query === 'object') {
24 ({
25 q
26 } = query);
27 ({
28 role
29 } = query);
30 ({
31 permissions
32 } = query)
33 } else {
34 q = query.replace(/role:([^ ]+) /, function (dummy, m1) {
35 role = m1
36 return ''
37 })
38 }
39
40 const data = { adminSearch: q }
41 if (role != null) { data.role = role }
42 if (permissions != null) { data.permissions = permissions }
43 return fetchJson('/db/user', { data })
44 },
45
46 fetchOnlineTeacherInfo (userId) {
47 return fetchJson(`/db/online-teachers/${userId}`)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected