#last @method -rename
This commit is contained in:
@@ -108,7 +108,7 @@ export default {
|
||||
logOut,
|
||||
getConfig,
|
||||
getPostComments,
|
||||
last,
|
||||
getLastComments,
|
||||
counts,
|
||||
getComment,
|
||||
getUserComments,
|
||||
|
||||
@@ -5,6 +5,7 @@ import { BASE_URL, DEFAULT_LAST_COMMENTS_MAX, LAST_COMMENTS_NODE_CLASSNAME } fro
|
||||
import api from 'common/api';
|
||||
|
||||
import ListComments from 'components/list-comments';
|
||||
import {getLastComments} from "./common/api";
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', init);
|
||||
@@ -39,7 +40,7 @@ function init() {
|
||||
|
||||
[].slice.call(nodes).forEach(node => {
|
||||
const max = node.dataset.max || remark_config.max_last_comments || DEFAULT_LAST_COMMENTS_MAX;
|
||||
api.last({ max, siteId: remark_config.site_id })
|
||||
api.getLastComments({ max, siteId: remark_config.site_id })
|
||||
.then(comments => {
|
||||
try {
|
||||
render(<ListComments comments={comments}/>, node);
|
||||
|
||||
Reference in New Issue
Block a user