メンテナ情報をDBに保存するように

This commit is contained in:
syuilo 2018-11-07 01:12:26 +09:00
parent 2de48110bb
commit 06b66f0209
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
15 changed files with 77 additions and 33 deletions

View file

@ -114,7 +114,21 @@ export const meta = {
proxyAccount: {
validator: $.str.optional.nullable,
desc: {
'ja-JP': 'Proxy account username'
'ja-JP': 'プロキシアカウントのユーザー名'
}
},
maintainerName: {
validator: $.str.optional,
desc: {
'ja-JP': 'インスタンスの管理者名'
}
},
maintainerEmail: {
validator: $.str.optional.nullable,
desc: {
'ja-JP': 'インスタンス管理者の連絡先メールアドレス'
}
}
}
@ -183,6 +197,14 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
set.proxyAccount = ps.proxyAccount;
}
if (ps.maintainerName !== undefined) {
set['maintainer.name'] = ps.maintainerName;
}
if (ps.maintainerEmail !== undefined) {
set['maintainer.email'] = ps.maintainerEmail;
}
await Meta.update({}, {
$set: set
}, { upsert: true });