]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/oauth-clients.ts
WIP plugins: move plugin CLI in peertube script
[github/Chocobozzz/PeerTube.git] / server / controllers / api / oauth-clients.ts
index ac1ee9e36f44cf481c151d15d8861ff37c09feaa..b2de8bcf5d371b9ece46bf43cc703ac667ceb48a 100644 (file)
@@ -1,10 +1,9 @@
 import * as express from 'express'
-
-import { CONFIG } from '../../initializers'
-import { logger } from '../../helpers'
-import { asyncMiddleware } from '../../middlewares'
-import { database as db } from '../../initializers/database'
 import { OAuthClientLocal } from '../../../shared'
+import { logger } from '../../helpers/logger'
+import { CONFIG } from '../../initializers/config'
+import { asyncMiddleware } from '../../middlewares'
+import { OAuthClientModel } from '../../models/oauth/oauth-client'
 
 const oauthClientsRouter = express.Router()
 
@@ -27,7 +26,7 @@ async function getLocalClient (req: express.Request, res: express.Response, next
     return res.type('json').status(403).end()
   }
 
-  const client = await db.OAuthClient.loadFirstClient()
+  const client = await OAuthClientModel.loadFirstClient()
   if (!client) throw new Error('No client available.')
 
   const json: OAuthClientLocal = {