Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix(question): (#562) 搜索问题时排序方法不对的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Oct 16, 2018
1 parent a842ddd commit 89cdb47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/page/post/PostQuestion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ export default {
*/
serachQuestionByKey: _.debounce(async function() {
const data = await this.$store.dispatch("question/searchQuestion", {
keyword: this.question.title
keyword: this.question.title,
type: "all"
});
this.questions = data;
}, 450),
Expand Down
4 changes: 2 additions & 2 deletions src/stores/module/question.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const actions = {
},

async searchQuestion(state, payload) {
const { keyword = "" } = payload;
const { keyword = "", type } = payload;
if (!keyword) return Promise.resolve([]);
const { data } = await questionApi.queryList({ subject: keyword });
const { data } = await questionApi.queryList({ subject: keyword, type });
return data || [];
},

Expand Down

0 comments on commit 89cdb47

Please sign in to comment.