refactor: use user_servers junction table instead of JSON column
This commit is contained in:
@@ -60,7 +60,7 @@ const UsersPage = {
|
||||
async loadUserServers(id, username, email, gameName, gameUid, role, active, source) {
|
||||
let groups = [], userServers = [];
|
||||
try { groups = await API.get('/polls/groups'); } catch {}
|
||||
try { const u = await API.get('/users/'+id); userServers = u.admin_servers ? (typeof u.admin_servers==='string'?JSON.parse(u.admin_servers):u.admin_servers) : []; } catch {}
|
||||
try { userServers = await API.get('/users/'+id+'/servers'); } catch {}
|
||||
const checks = groups.map(g => {
|
||||
const key = g.group_name+'::'+g.server_name;
|
||||
const has = userServers.some(s => s.group_name===g.group_name && s.server_name===g.server_name);
|
||||
|
||||
Reference in New Issue
Block a user