Use FSharpLu for JSON serialization (#24)

This commit is contained in:
Daniel J. Summers
2019-02-23 13:59:32 -06:00
parent 8995097d68
commit d738321dc0
5 changed files with 24 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "my-prayer-journal",
"version": "1.0.2",
"version": "1.1.0",
"description": "myPrayerJournal - Front End",
"author": "Daniel J. Summers <daniel@bitbadger.solutions>",
"private": true,

View File

@@ -15,7 +15,7 @@ article.mpj-main-content(role='main')
tbody
tr(v-for='item in log' :key='item.asOf')
td {{ item.status }} on #[span.mpj-text-nowrap {{ formatDate(item.asOf) }}]
td(v-if='item.text').mpj-request-text {{ item.text.fields[0] }}
td(v-if='item.text').mpj-request-text {{ item.text }}
td(v-else) &nbsp;
p(v-else) Loading request...
</template>
@@ -52,11 +52,11 @@ export default {
lastText () {
return this.request.history
.filter(hist => hist.text)
.sort(asOfDesc)[0].text.fields[0]
.sort(asOfDesc)[0].text
},
log () {
const allHistory = (this.request.notes || [])
.map(note => ({ asOf: note.asOf, text: { case: 'Some', fields: [ note.notes ] }, status: 'Notes' }))
.map(note => ({ asOf: note.asOf, text: note.notes, status: 'Notes' }))
.concat(this.request.history)
.sort(asOfDesc)
// Skip the first entry for answered requests; that info is already displayed