Counts comments, given the specified filtering. Comments with the HIDDEN
status are not included in the response.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function countComments(
appId: string,
options: CountCommentsOptions,
): Promise<CountCommentsResponse>;
App ID to count the comments of.
import { comments } from "wix-comments.v2";
async function countComments(appId, options) {
try {
const result = await comments.countComments(appId, options);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.