aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures/peertube-plugin-test-four
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-02 15:29:00 +0200
committerChocobozzz <me@florianbigard.com>2022-08-02 15:50:05 +0200
commit22df69fdecf299c8be6acaa25f086249ea9a0085 (patch)
treee8c7e21c18fb42bb74b54f2eab1509c3d93a380d /server/tests/fixtures/peertube-plugin-test-four
parent7a9e420a02434e4f16c99e7d58da9075dff25d15 (diff)
downloadPeerTube-22df69fdecf299c8be6acaa25f086249ea9a0085.tar.gz
PeerTube-22df69fdecf299c8be6acaa25f086249ea9a0085.tar.zst
PeerTube-22df69fdecf299c8be6acaa25f086249ea9a0085.zip
Add job queue hooks
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-four')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-four/main.js10
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,