From 4610bc5b12eaa4bfd64fe3fd70c65e5b722aa22d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 16 Nov 2017 17:16:42 +0100 Subject: ApplicationFollow -> SeverFollow --- server/controllers/api/index.ts | 4 ++-- server/controllers/api/server/follows.ts | 20 ++++++++++---------- server/controllers/api/server/index.ts | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts index 876c911c7..b00fb7467 100644 --- a/server/controllers/api/index.ts +++ b/server/controllers/api/index.ts @@ -4,13 +4,13 @@ import { badRequest } from '../../helpers' import { oauthClientsRouter } from './oauth-clients' import { configRouter } from './config' -import { applicationRouter } from './server' +import { serverRouter } from './server' import { usersRouter } from './users' import { videosRouter } from './videos' const apiRouter = express.Router() -apiRouter.use('/application', applicationRouter) +apiRouter.use('/server', serverRouter) apiRouter.use('/oauth-clients', oauthClientsRouter) apiRouter.use('/config', configRouter) apiRouter.use('/users', usersRouter) diff --git a/server/controllers/api/server/follows.ts b/server/controllers/api/server/follows.ts index e00787f02..520d4d858 100644 --- a/server/controllers/api/server/follows.ts +++ b/server/controllers/api/server/follows.ts @@ -15,9 +15,9 @@ import { ensureUserHasRight } from '../../../middlewares/user-right' import { followValidator } from '../../../middlewares/validators/servers' import { followersSortValidator, followingSortValidator } from '../../../middlewares/validators/sort' -const applicationFollowsRouter = express.Router() +const serverFollowsRouter = express.Router() -applicationFollowsRouter.get('/following', +serverFollowsRouter.get('/following', paginationValidator, followingSortValidator, setFollowingSort, @@ -25,15 +25,15 @@ applicationFollowsRouter.get('/following', asyncMiddleware(listFollowing) ) -applicationFollowsRouter.post('/follow', +serverFollowsRouter.post('/follow', authenticate, - ensureUserHasRight(UserRight.MANAGE_APPLICATION_FOLLOW), + ensureUserHasRight(UserRight.MANAGE_SERVER_FOLLOW), followValidator, setBodyHostsPort, asyncMiddleware(follow) ) -applicationFollowsRouter.get('/followers', +serverFollowsRouter.get('/followers', paginationValidator, followersSortValidator, setFollowersSort, @@ -44,21 +44,21 @@ applicationFollowsRouter.get('/followers', // --------------------------------------------------------------------------- export { - applicationFollowsRouter + serverFollowsRouter } // --------------------------------------------------------------------------- async function listFollowing (req: express.Request, res: express.Response, next: express.NextFunction) { - const applicationAccount = await getServerAccount() - const resultList = await db.AccountFollow.listFollowingForApi(applicationAccount.id, req.query.start, req.query.count, req.query.sort) + const serverAccount = await getServerAccount() + const resultList = await db.AccountFollow.listFollowingForApi(serverAccount.id, req.query.start, req.query.count, req.query.sort) return res.json(getFormattedObjects(resultList.data, resultList.total)) } async function listFollowers (req: express.Request, res: express.Response, next: express.NextFunction) { - const applicationAccount = await getServerAccount() - const resultList = await db.AccountFollow.listFollowersForApi(applicationAccount.id, req.query.start, req.query.count, req.query.sort) + const serverAccount = await getServerAccount() + const resultList = await db.AccountFollow.listFollowersForApi(serverAccount.id, req.query.start, req.query.count, req.query.sort) return res.json(getFormattedObjects(resultList.data, resultList.total)) } diff --git a/server/controllers/api/server/index.ts b/server/controllers/api/server/index.ts index 011b971ed..8dc1a0031 100644 --- a/server/controllers/api/server/index.ts +++ b/server/controllers/api/server/index.ts @@ -1,12 +1,12 @@ import * as express from 'express' -import { applicationFollowsRouter } from './follows' +import { serverFollowsRouter } from './follows' -const applicationRouter = express.Router() +const serverRouter = express.Router() -applicationRouter.use('/', applicationFollowsRouter) +serverRouter.use('/', serverFollowsRouter) // --------------------------------------------------------------------------- export { - applicationRouter + serverRouter } -- cgit v1.2.3