Update recurrence before status (#25); version bump

This commit is contained in:
Daniel J. Summers
2019-07-05 20:34:38 -05:00
parent 68b650e31d
commit 42615dae82
5 changed files with 548 additions and 458 deletions

View File

@@ -104,12 +104,12 @@ export default new Vuex.Store({
progress.start()
try {
let oldReq = (state.journal.filter(req => req.requestId === requestId) || [])[0] || {}
if (status !== 'Updated' || oldReq.text !== updateText) {
await api.updateRequest(requestId, status, updateText)
}
if (status === 'Updated' && (oldReq.recurType !== recurType || oldReq.recurCount !== recurCount)) {
if (status !== 'Answered' && (oldReq.recurType !== recurType || oldReq.recurCount !== recurCount)) {
await api.updateRecurrence(requestId, recurType, recurCount)
}
if (status !== 'Updated' || oldReq.text !== updateText) {
await api.updateRequest(requestId, status, oldReq.text !== updateText ? updateText : '')
}
const request = await api.getRequest(requestId)
commit(mutations.REQUEST_UPDATED, request.data)
progress.finish()