投稿の最大文字数情報を設定ファイルではなくDBに保存するように

This commit is contained in:
syuilo 2018-11-05 11:09:05 +09:00
parent 10c434f24a
commit d7a3b71028
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
10 changed files with 37 additions and 16 deletions

View file

@ -59,6 +59,13 @@ export const meta = {
'ja-JP': 'インスタンスの紹介文'
}
},
maxNoteTextLength: {
validator: $.num.optional.min(1),
desc: {
'ja-JP': '投稿の最大文字数'
}
}
}
};
@ -93,6 +100,10 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
set.description = ps.description;
}
if (ps.maxNoteTextLength) {
set.maxNoteTextLength = ps.maxNoteTextLength;
}
await Meta.update({}, {
$set: set
}, { upsert: true });