mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 18:29:08 +00:00
v2: init -- UI is nuked from orbit, major app restructuring
This commit is contained in:
parent
c6f5b55c1c
commit
b8da886601
108 changed files with 6717 additions and 17430 deletions
26
api/servers_test.js
Normal file
26
api/servers_test.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
module.exports = (R, $) => {
|
||||
R.get('/api/~/relevant-servers/:user', (ctx, next) => {
|
||||
// ctx.body = 'ok'
|
||||
const srv = $.discord.getRelevantServers(ctx.params.user)
|
||||
ctx.body = $.discord.presentableServers(srv, ctx.params.user)
|
||||
return
|
||||
})
|
||||
|
||||
R.get('/api/~/roles/:id/:userId', (ctx, next) => {
|
||||
// ctx.body = 'ok'
|
||||
const { id, userId } = ctx.params
|
||||
|
||||
const srv = $.discord.client.guilds.get(id)
|
||||
|
||||
if (srv === undefined) {
|
||||
ctx.body = { err: 'not found' }
|
||||
ctx.status = 404
|
||||
return
|
||||
}
|
||||
|
||||
const gm = srv.members.get(userId)
|
||||
const roles = $.discord.presentableRoles(id, gm)
|
||||
|
||||
ctx.boy = roles
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue