diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-20 16:24:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 16:24:31 +0200 |
commit | 0491173a61aed66205c017e0d7e0503ea316c144 (patch) | |
tree | ce6621597505f9518cfdf0981977d097c63f9fad /server/controllers/api/config.ts | |
parent | 8704acf49efc770d73bf07c10468ed8c74d28a83 (diff) | |
parent | 6247b2057b792cea155a1abd9788c363ae7d2cc2 (diff) | |
download | PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.gz PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.zst PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.zip |
Merge branch 'develop' into cli-wrapper
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 6edbe4820..95549b724 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -8,7 +8,7 @@ import { CONFIG, CONSTRAINTS_FIELDS, reloadConfig } from '../../initializers' | |||
8 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' | 8 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' |
9 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' | 9 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' |
10 | import { ClientHtml } from '../../lib/client-html' | 10 | import { ClientHtml } from '../../lib/client-html' |
11 | import { auditLoggerFactory, CustomConfigAuditView } from '../../helpers/audit-logger' | 11 | import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '../../helpers/audit-logger' |
12 | import { remove, writeJSON } from 'fs-extra' | 12 | import { remove, writeJSON } from 'fs-extra' |
13 | 13 | ||
14 | const packageJSON = require('../../../../package.json') | 14 | const packageJSON = require('../../../../package.json') |
@@ -134,10 +134,7 @@ async function getCustomConfig (req: express.Request, res: express.Response, nex | |||
134 | async function deleteCustomConfig (req: express.Request, res: express.Response, next: express.NextFunction) { | 134 | async function deleteCustomConfig (req: express.Request, res: express.Response, next: express.NextFunction) { |
135 | await remove(CONFIG.CUSTOM_FILE) | 135 | await remove(CONFIG.CUSTOM_FILE) |
136 | 136 | ||
137 | auditLogger.delete( | 137 | auditLogger.delete(getAuditIdFromRes(res), new CustomConfigAuditView(customConfig())) |
138 | res.locals.oauth.token.User.Account.Actor.getIdentifier(), | ||
139 | new CustomConfigAuditView(customConfig()) | ||
140 | ) | ||
141 | 138 | ||
142 | reloadConfig() | 139 | reloadConfig() |
143 | ClientHtml.invalidCache() | 140 | ClientHtml.invalidCache() |
@@ -183,7 +180,7 @@ async function updateCustomConfig (req: express.Request, res: express.Response, | |||
183 | const data = customConfig() | 180 | const data = customConfig() |
184 | 181 | ||
185 | auditLogger.update( | 182 | auditLogger.update( |
186 | res.locals.oauth.token.User.Account.Actor.getIdentifier(), | 183 | getAuditIdFromRes(res), |
187 | new CustomConfigAuditView(data), | 184 | new CustomConfigAuditView(data), |
188 | oldCustomConfigAuditKeys | 185 | oldCustomConfigAuditKeys |
189 | ) | 186 | ) |