(query)
| 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}`) |
nothing calls this directly
no outgoing calls
no test coverage detected