Skip to content

Commit

Permalink
lint通過
Browse files Browse the repository at this point in the history
  • Loading branch information
eatplaynap committed Mar 21, 2022
1 parent fc9fbab commit 580a4b3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
6 changes: 4 additions & 2 deletions app/javascript/users-answer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@
.answer-badge__label ベストアンサー
</template>
<script>
import dayjs from "dayjs"
import dayjs from 'dayjs'
export default {
props: {
answer: { type: Object, required: true }
},
computed: {
updatedAt() {
return dayjs(this.answer.question.updated_at).format('YYYY年MM月DD日(dd) HH:mm')
return dayjs(this.answer.question.updated_at).format(
'YYYY年MM月DD日(dd) HH:mm'
)
},
answerCreatedAt: function () {
return dayjs(this.answer.question.created_at).format()
Expand Down
33 changes: 14 additions & 19 deletions app/javascript/users-answers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@ div
p.o-empty-message__text
| 回答はまだありません。
.thread-list.a-card(v-else)
usersAnswer(
v-for='answer in answers',
:key='answer.id',
:answer='answer'
)
usersAnswer(v-for='answer in answers', :key='answer.id', :answer='answer')
nav.pagination(v-if='totalPages > 1')
pager(v-bind='pagerProps')

</template>

<script>
Expand Down Expand Up @@ -91,20 +86,20 @@ export default {
credentials: 'same-origin',
redirect: 'manual'
})
.then((response) => {
return response.json()
})
.then((json) => {
this.answers = []
json.answers.forEach((r) => {
this.answers.push(r)
console.log(this.answers)
})
this.totalPages = parseInt(json.totalPages)
})
.catch((error) => {
console.warn(error)
.then((response) => {
return response.json()
})
.then((json) => {
this.answers = []
json.answers.forEach((r) => {
this.answers.push(r)
console.log(this.answers)
})
this.totalPages = parseInt(json.totalPages)
})
.catch((error) => {
console.warn(error)
})
}
}
}
Expand Down

0 comments on commit 580a4b3

Please sign in to comment.