投稿の最大文字数情報を設定ファイルではなくDBに保存するように
This commit is contained in:
@ -43,4 +43,9 @@ export type IMeta = {
|
||||
disableLocalTimeline?: boolean;
|
||||
hidedTags?: string[];
|
||||
bannerUrl?: string;
|
||||
|
||||
/**
|
||||
* Max allowed note text length in charactors
|
||||
*/
|
||||
maxNoteTextLength?: number;
|
||||
};
|
||||
|
@ -11,7 +11,6 @@ import Reaction from './note-reaction';
|
||||
import { packMany as packFileMany, IDriveFile } from './drive-file';
|
||||
import Favorite from './favorite';
|
||||
import Following from './following';
|
||||
import config from '../config';
|
||||
import Emoji from './emoji';
|
||||
|
||||
const Note = db.get<INote>('notes');
|
||||
@ -27,10 +26,6 @@ Note.createIndex({ createdAt: -1 });
|
||||
Note.createIndex({ score: -1 }, { sparse: true });
|
||||
export default Note;
|
||||
|
||||
export function isValidText(text: string): boolean {
|
||||
return length(text.trim()) <= config.maxNoteTextLength && text.trim() != '';
|
||||
}
|
||||
|
||||
export function isValidCw(text: string): boolean {
|
||||
return length(text.trim()) <= 100;
|
||||
}
|
||||
|
Reference in New Issue
Block a user