diff options
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-four/main.js')
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test-four/main.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-four/main.js b/server/tests/fixtures/peertube-plugin-test-four/main.js index bff42ff40..5194e3e02 100644 --- a/server/tests/fixtures/peertube-plugin-test-four/main.js +++ b/server/tests/fixtures/peertube-plugin-test-four/main.js | |||
@@ -88,6 +88,15 @@ async function register ({ | |||
88 | return res.json({ routerRoute }) | 88 | return res.json({ routerRoute }) |
89 | }) | 89 | }) |
90 | 90 | ||
91 | router.get('/user/:id', async (req, res) => { | ||
92 | const user = await peertubeHelpers.user.loadById(req.params.id) | ||
93 | if (!user) return res.status(404).end() | ||
94 | |||
95 | return res.json({ | ||
96 | username: user.username | ||
97 | }) | ||
98 | }) | ||
99 | |||
91 | router.get('/user', async (req, res) => { | 100 | router.get('/user', async (req, res) => { |
92 | const user = await peertubeHelpers.user.getAuthUser(res) | 101 | const user = await peertubeHelpers.user.getAuthUser(res) |
93 | if (!user) return res.sendStatus(404) | 102 | if (!user) return res.sendStatus(404) |
@@ -97,6 +106,7 @@ async function register ({ | |||
97 | const isUser = user.role === 2 | 106 | const isUser = user.role === 2 |
98 | 107 | ||
99 | return res.json({ | 108 | return res.json({ |
109 | id: user.id, | ||
100 | username: user.username, | 110 | username: user.username, |
101 | displayName: user.Account.name, | 111 | displayName: user.Account.name, |
102 | isAdmin, | 112 | isAdmin, |