File size: 811 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { COMMENTS_QUERY_UPDATE } from 'calypso/state/action-types';

import 'calypso/state/comments/init';

/**
 * Creates an action that updates the comments pagination for the given site and filters.
 * @param {number} siteId Site identifier.
 * @param {Array<Object>} comments List of comments.
 * @param {Object} query Current filter parameters.
 * @param {string} [query.order] Query order ('ASC' or 'DESC').
 * @param {number} query.page Page to update.
 * @param {number} [query.postId] Post identifier.
 * @param {string} [query.search] Search query.
 * @param {string} query.status Comments status.
 * @returns {Object} Action that updates the comments pagination.
 */
export const updateCommentsQuery = ( siteId, comments, query ) => ( {
	type: COMMENTS_QUERY_UPDATE,
	siteId,
	comments,
	query,
} );