removed useless code
Massimo Melina committed
Oct 23, 2023 at 11:20 UTC
64da0bca096941960fe7442a276a25c93927114a
2 files changed
-7
src/api.accounts.ts
-5
@@ -45,11 +45,6 @@ const apis: ApiHandlers = {
45
},
46
47
set_account({ username, changes }, ctx) {
48
- const { admin } = changes
49
- if (admin === null)
50
- changes.admin = undefined
51
- else if (admin !== undefined && typeof admin !== 'boolean')
52
- return new ApiError(HTTP_BAD_REQUEST, "invalid admin")
48
const acc = getAccount(username)
49
if (!acc)
50
return new ApiError(HTTP_BAD_REQUEST)
src/perm.ts
-2
@@ -164,8 +164,6 @@ export function setAccount(acc: Account, changes: Partial<Account>) {
164
if (!v)
165
rest[k as keyof Account] = undefined
166
Object.assign(acc, rest)
167
- if (!acc.disabled)
168
- delete acc.disabled
167
if (changes.username)
168
renameAccount(acc.username, changes.username)
169
saveAccountsAsap()