やった
This commit is contained in:
		@@ -35,6 +35,10 @@ module.exports = async (params, user) => {
 | 
			
		||||
		throw 'only one of sinceId, untilId, sinceDate, untilDate can be specified';
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Get 'mediaOnly' parameter
 | 
			
		||||
	const [mediaOnly, mediaOnlyErr] = $.bool.optional().get(params.mediaOnly);
 | 
			
		||||
	if (mediaOnlyErr) throw 'invalid mediaOnly param';
 | 
			
		||||
 | 
			
		||||
	// ミュートしているユーザーを取得
 | 
			
		||||
	const mutedUserIds = user ? (await Mute.find({
 | 
			
		||||
		muterId: user._id
 | 
			
		||||
@@ -64,6 +68,10 @@ module.exports = async (params, user) => {
 | 
			
		||||
		};
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (mediaOnly) {
 | 
			
		||||
		query.mediaIds = { $exists: true, $ne: [] };
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (sinceId) {
 | 
			
		||||
		sort._id = 1;
 | 
			
		||||
		query._id = {
 | 
			
		||||
 
 | 
			
		||||
@@ -35,6 +35,10 @@ module.exports = async (params, user) => {
 | 
			
		||||
		throw 'only one of sinceId, untilId, sinceDate, untilDate can be specified';
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Get 'mediaOnly' parameter
 | 
			
		||||
	const [mediaOnly, mediaOnlyErr] = $.bool.optional().get(params.mediaOnly);
 | 
			
		||||
	if (mediaOnlyErr) throw 'invalid mediaOnly param';
 | 
			
		||||
 | 
			
		||||
	// ミュートしているユーザーを取得
 | 
			
		||||
	const mutedUserIds = user ? (await Mute.find({
 | 
			
		||||
		muterId: user._id
 | 
			
		||||
@@ -67,6 +71,10 @@ module.exports = async (params, user) => {
 | 
			
		||||
		};
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (mediaOnly) {
 | 
			
		||||
		query.mediaIds = { $exists: true, $ne: [] };
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (sinceId) {
 | 
			
		||||
		sort._id = 1;
 | 
			
		||||
		query._id = {
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,10 @@ module.exports = async (params, user, app) => {
 | 
			
		||||
	const [includeRenotedMyNotes = true, includeRenotedMyNotesErr] = $.bool.optional().get(params.includeRenotedMyNotes);
 | 
			
		||||
	if (includeRenotedMyNotesErr) throw 'invalid includeRenotedMyNotes param';
 | 
			
		||||
 | 
			
		||||
	// Get 'mediaOnly' parameter
 | 
			
		||||
	const [mediaOnly, mediaOnlyErr] = $.bool.optional().get(params.mediaOnly);
 | 
			
		||||
	if (mediaOnlyErr) throw 'invalid mediaOnly param';
 | 
			
		||||
 | 
			
		||||
	const [followings, mutedUserIds] = await Promise.all([
 | 
			
		||||
		// フォローを取得
 | 
			
		||||
		// Fetch following
 | 
			
		||||
@@ -137,6 +141,12 @@ module.exports = async (params, user, app) => {
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (mediaOnly) {
 | 
			
		||||
		query.$and.push({
 | 
			
		||||
			mediaIds: { $exists: true, $ne: [] }
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (sinceId) {
 | 
			
		||||
		sort._id = 1;
 | 
			
		||||
		query._id = {
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,10 @@ module.exports = async (params, user, app) => {
 | 
			
		||||
	const [includeRenotedMyNotes = true, includeRenotedMyNotesErr] = $.bool.optional().get(params.includeRenotedMyNotes);
 | 
			
		||||
	if (includeRenotedMyNotesErr) throw 'invalid includeRenotedMyNotes param';
 | 
			
		||||
 | 
			
		||||
	// Get 'mediaOnly' parameter
 | 
			
		||||
	const [mediaOnly, mediaOnlyErr] = $.bool.optional().get(params.mediaOnly);
 | 
			
		||||
	if (mediaOnlyErr) throw 'invalid mediaOnly param';
 | 
			
		||||
 | 
			
		||||
	// Get 'listId' parameter
 | 
			
		||||
	const [listId, listIdErr] = $.type(ID).get(params.listId);
 | 
			
		||||
	if (listIdErr) throw 'invalid listId param';
 | 
			
		||||
@@ -146,6 +150,12 @@ module.exports = async (params, user, app) => {
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (mediaOnly) {
 | 
			
		||||
		query.$and.push({
 | 
			
		||||
			mediaIds: { $exists: true, $ne: [] }
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (sinceId) {
 | 
			
		||||
		sort._id = 1;
 | 
			
		||||
		query._id = {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user