Skip to content

Commit ac1e03f

Browse files
committed
Fix remarks
1 parent 863ed08 commit ac1e03f

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

frontend/src/components/view/user/UserContainer.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export default {
2929
3030
async created() {
3131
try {
32-
this.tweets = await this.fetchTweetsByUserId({
33-
userId: this.$route.params.id,
32+
this.tweets = await this.fetchTweetsByUserId({
33+
userId: this.$route.params.id,
3434
params: {
3535
page: 1
3636
}
@@ -67,7 +67,7 @@ export default {
6767
}
6868
} catch (error) {
6969
this.showErrorMessage(error.message);
70-
$state.loaded();
70+
$state.complete();
7171
}
7272
},
7373
},

frontend/src/store/modules/tweet/actions.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ import api from '@/api/Api';
99
import { tweetMapper } from '@/services/Normalizer';
1010

1111
export default {
12-
async fetchTweets({ commit }, params) {
12+
async fetchTweets({ commit }, { page }) {
1313
commit(SET_LOADING, true, { root: true });
1414

1515
try {
16-
const data = await api.get('/tweets', params);
16+
const tweets = await api.get('/tweets', { page });
1717

18-
commit(SET_TWEETS, data);
18+
commit(SET_TWEETS, tweets);
1919
commit(SET_LOADING, false, { root: true });
2020

21-
return Promise.resolve(data);
21+
return Promise.resolve(
22+
tweets.map(tweetMapper)
23+
);
2224
} catch (error) {
2325
commit(SET_LOADING, false, { root: true });
2426

0 commit comments

Comments
 (0)