Authored by 王钱钧

修改个人中心我的帖子接口传参。 code review by 于良

'use strict'
'use strict'
import ReactNative from 'react-native';
import {Actions} from 'react-native-router-flux';
... ... @@ -181,12 +181,13 @@ export function posts(ptr = false) {
dispatch(postRequest(ptr));
let uid = user.profile.uid;
let loginUid = user.profile.uid;
let lastedTime = 0;
if (!ptr) {
lastedTime = user.posts.lastedTime;
}
let limit = LIMIT;
return new UserService().posts(uid, lastedTime, limit)
return new UserService().posts(uid, loginUid, lastedTime, limit)
.then(json => {
let payload = parseJson(json);
if (!ptr) {
... ...
... ... @@ -101,7 +101,7 @@ export function tnmPostFailure(sid, error) {
export function userThatNotMePosts(sid) {
return (dispatch, getState) => {
let {userThatNotMe} = getState();
let {user, userThatNotMe} = getState();
let item = userThatNotMe.items.get(sid);
if (item.posts.isFetching || item.posts.error) {
return;
... ... @@ -112,7 +112,8 @@ export function userThatNotMePosts(sid) {
let uid = item.profile.uid;
let lastedTime = item.posts.lastedTime;
let limit = 10;
return new UserService().posts(uid, lastedTime, limit)
let loginUid = user.profile.uid;
return new UserService().posts(uid,loginUid, lastedTime, limit)
.then(json => {
let payload = parseUserThatNotMePosts(json);
let oldList = item.posts.list.toJS();
... ...
... ... @@ -56,14 +56,15 @@ export default class UserService {
});
}
async posts(uid, lastedTime, limit) {
async posts(uid,loginUid, lastedTime, limit) {
return await this.api.get({
url: '',
body: {
method: 'app.social.getMyPostList',
uid,
lastedTime,
limit
limit,
loginUid
}
})
.then((json) => {
... ...