Disable prev/next
This commit is contained in:
		
							parent
							
								
									d4b696d03a
								
							
						
					
					
						commit
						9f4624283d
					
				
					 1 changed files with 4 additions and 35 deletions
				
			
		| 
						 | 
					@ -271,41 +271,10 @@ export const pack = async (
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// When requested a detailed note data
 | 
						// When requested a detailed note data
 | 
				
			||||||
	if (opts.detail) {
 | 
						if (opts.detail) {
 | 
				
			||||||
		// Get previous note info
 | 
							//#region 重いので廃止
 | 
				
			||||||
		_note.prev = (async () => {
 | 
							_note.prev = null;
 | 
				
			||||||
			const prev = await Note.findOne({
 | 
							_note.next = null;
 | 
				
			||||||
				userId: _note.userId,
 | 
							//#endregion
 | 
				
			||||||
				_id: {
 | 
					 | 
				
			||||||
					$lt: id
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}, {
 | 
					 | 
				
			||||||
				fields: {
 | 
					 | 
				
			||||||
					_id: true
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				sort: {
 | 
					 | 
				
			||||||
					_id: -1
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			});
 | 
					 | 
				
			||||||
			return prev ? prev._id.toHexString() : null;
 | 
					 | 
				
			||||||
		})();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		// Get next note info
 | 
					 | 
				
			||||||
		_note.next = (async () => {
 | 
					 | 
				
			||||||
			const next = await Note.findOne({
 | 
					 | 
				
			||||||
				userId: _note.userId,
 | 
					 | 
				
			||||||
				_id: {
 | 
					 | 
				
			||||||
					$gt: id
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}, {
 | 
					 | 
				
			||||||
				fields: {
 | 
					 | 
				
			||||||
					_id: true
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				sort: {
 | 
					 | 
				
			||||||
					_id: 1
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			});
 | 
					 | 
				
			||||||
			return next ? next._id.toHexString() : null;
 | 
					 | 
				
			||||||
		})();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (_note.replyId) {
 | 
							if (_note.replyId) {
 | 
				
			||||||
			// Populate reply to note
 | 
								// Populate reply to note
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue