mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 14:41:28 -07:00
more endpoints
This commit is contained in:
@@ -205,12 +205,11 @@ const app = new Hono<App>()
|
||||
return c.json({ success: true })
|
||||
})
|
||||
|
||||
// Developer role lookup. Not implemented yet.
|
||||
// Developer role lookup. No developer role granted by default.
|
||||
.get('/role/developer/:id', (c) => {
|
||||
const { id } = c.req.param()
|
||||
logger.info('developer role lookup', { id })
|
||||
// TODO: implement
|
||||
return c.json({ success: true })
|
||||
return c.json({ success: false })
|
||||
})
|
||||
|
||||
export default app
|
||||
|
||||
@@ -212,10 +212,10 @@ describe('auth worker routes', () => {
|
||||
expect(await rotate.json()).toEqual({ success: true })
|
||||
})
|
||||
|
||||
test('GET /role/developer/:id returns ok', async () => {
|
||||
test('GET /role/developer/:id does not grant developer', async () => {
|
||||
const res = await exports.default.fetch(`${ORIGIN}/role/developer/42`)
|
||||
expect(res.status).toBe(200)
|
||||
expect(await res.json()).toEqual({ success: true })
|
||||
expect(await res.json()).toEqual({ success: false })
|
||||
})
|
||||
|
||||
test('unknown path returns 404', async () => {
|
||||
|
||||
Reference in New Issue
Block a user