Fix bug
This commit is contained in:
		
							parent
							
								
									afeb8058b1
								
							
						
					
					
						commit
						dc2055f5bc
					
				
					 1 changed files with 15 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -26,6 +26,21 @@ Note.createIndex({
 | 
			
		|||
});
 | 
			
		||||
export default Note;
 | 
			
		||||
 | 
			
		||||
// 後方互換性のため
 | 
			
		||||
Note.findOne({
 | 
			
		||||
	fileIds: { $exists: true }
 | 
			
		||||
}).then(n => {
 | 
			
		||||
	if (n == null) {
 | 
			
		||||
		Note.update({}, {
 | 
			
		||||
			$rename: {
 | 
			
		||||
				mediaIds: 'fileIds'
 | 
			
		||||
			}
 | 
			
		||||
		}, {
 | 
			
		||||
			multi: true
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export function isValidText(text: string): boolean {
 | 
			
		||||
	return length(text.trim()) <= 1000 && text.trim() != '';
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue