diff options
author | Chocobozzz <me@florianbigard.com> | 2019-05-31 14:02:26 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-05-31 14:49:31 +0200 |
commit | 57cfff78858b2360d9e038e2a504b761cb51da47 (patch) | |
tree | 28575a83f1680f9c40f04b8a71b4f2eb35f90400 /server/helpers/custom-validators/accounts.ts | |
parent | 4c72c1cd411b4ff7ed054b584f184117bae91d5b (diff) | |
download | PeerTube-57cfff78858b2360d9e038e2a504b761cb51da47.tar.gz PeerTube-57cfff78858b2360d9e038e2a504b761cb51da47.tar.zst PeerTube-57cfff78858b2360d9e038e2a504b761cb51da47.zip |
Remove unused actor uuid field
Diffstat (limited to 'server/helpers/custom-validators/accounts.ts')
-rw-r--r-- | server/helpers/custom-validators/accounts.ts | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/server/helpers/custom-validators/accounts.ts b/server/helpers/custom-validators/accounts.ts index 146c7708e..31a2de5ca 100644 --- a/server/helpers/custom-validators/accounts.ts +++ b/server/helpers/custom-validators/accounts.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import * as Bluebird from 'bluebird' | 1 | import * as Bluebird from 'bluebird' |
2 | import { Response } from 'express' | 2 | import { Response } from 'express' |
3 | import 'express-validator' | 3 | import 'express-validator' |
4 | import * as validator from 'validator' | ||
5 | import { AccountModel } from '../../models/account/account' | 4 | import { AccountModel } from '../../models/account/account' |
6 | import { isUserDescriptionValid, isUserUsernameValid } from './users' | 5 | import { isUserDescriptionValid, isUserUsernameValid } from './users' |
7 | import { exists } from './misc' | 6 | import { exists } from './misc' |
@@ -18,14 +17,8 @@ function isAccountDescriptionValid (value: string) { | |||
18 | return isUserDescriptionValid(value) | 17 | return isUserDescriptionValid(value) |
19 | } | 18 | } |
20 | 19 | ||
21 | function doesAccountIdExist (id: number | string, res: Response, sendNotFound = true) { | 20 | function doesAccountIdExist (id: number, res: Response, sendNotFound = true) { |
22 | let promise: Bluebird<AccountModel> | 21 | const promise = AccountModel.load(id) |
23 | |||
24 | if (validator.isInt('' + id)) { | ||
25 | promise = AccountModel.load(+id) | ||
26 | } else { // UUID | ||
27 | promise = AccountModel.loadByUUID('' + id) | ||
28 | } | ||
29 | 22 | ||
30 | return doesAccountExist(promise, res, sendNotFound) | 23 | return doesAccountExist(promise, res, sendNotFound) |
31 | } | 24 | } |