Wrote API calls for history updates

Also switched app pkg mgt to yarn
This commit is contained in:
Daniel J. Summers
2017-09-22 19:27:23 -05:00
parent a6b5149b34
commit c703d717d8
10 changed files with 6676 additions and 11316 deletions
+4
View File
@@ -5,6 +5,10 @@
template(v-if="!isLoadingJournal")
new-request
p journal has {{ journal.length }} entries
el-row
el-col(:span='4'): strong Actions
el-col(:span='16'): strong Request
el-col(:span='4'): strong As Of
request-list-item(v-for="request in journal" v-bind:request="request" v-bind:key="request.requestId")
</template>
@@ -1,22 +1,34 @@
<template lang="pug">
el-row.journal-request(:id="request.requestId")
el-col(:span='4') Action buttons
el-col(:span='20')
p Id {{ request.requestId }} as of {{ request.asOf }}
p {{ request.text }}
el-row.journal-request
el-col(:span='4')
p
el-button(icon='check' @click='markPrayed()' title='Pray')
el-button(icon='edit' @click='editRequest()' title='Edit')
el-button(icon='document' @click='viewHistory()' title='Show History')
el-col(:span='16'): p {{ request.text }}
el-col(:span='4'): p {{ asOf }}
</template>
<script>
import moment from 'moment'
export default {
name: 'request-list-item',
props: ['request'],
data: function () {
data () {
return {}
},
methods: {
markPrayed: function (requestId) {
markPrayed () {
alert(`Marking ${this.request.requestId} prayed`)
// TODO: write function
}
},
computed: {
asOf () {
// FIXME: why isn't this already a number?
return moment(parseInt(this.request.asOf)).fromNow()
}
}
}
</script>