mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	Improve local timeline API
This commit is contained in:
		
							parent
							
								
									b5ff2abdb9
								
							
						
					
					
						commit
						e2c6227f47
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		| 
						 | 
					@ -23,6 +23,12 @@ export const meta = {
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}),
 | 
							}),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							fileType: $.arr($.str).optional.note({
 | 
				
			||||||
 | 
								desc: {
 | 
				
			||||||
 | 
									'ja-JP': '指定された種類のファイルが添付された投稿のみを取得します'
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		limit: $.num.optional.range(1, 100).note({
 | 
							limit: $.num.optional.range(1, 100).note({
 | 
				
			||||||
			default: 10
 | 
								default: 10
 | 
				
			||||||
		}),
 | 
							}),
 | 
				
			||||||
| 
						 | 
					@ -84,6 +90,14 @@ export default async (params: any, user: ILocalUser) => {
 | 
				
			||||||
		query.fileIds = { $exists: true, $ne: [] };
 | 
							query.fileIds = { $exists: true, $ne: [] };
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (ps.fileType) {
 | 
				
			||||||
 | 
							query.fileIds = { $exists: true, $ne: [] };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							query['_files.contentType'] = {
 | 
				
			||||||
 | 
								$in: ps.fileType
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ps.sinceId) {
 | 
						if (ps.sinceId) {
 | 
				
			||||||
		sort._id = 1;
 | 
							sort._id = 1;
 | 
				
			||||||
		query._id = {
 | 
							query._id = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue