Update checklist item when acked directly in the frontend
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
|
||||
import { onMounted, ref, useTemplateRef } from 'vue';
|
||||
import { onMounted, ref, useTemplateRef, inject } from 'vue';
|
||||
import { Button } from 'pankow';
|
||||
import { prettyDate } from 'pankow/utils';
|
||||
import { marked } from 'marked';
|
||||
@@ -22,12 +22,15 @@ const editing = ref(false);
|
||||
const busy = ref(false);
|
||||
const placeholder = 'Add admin notes here...';
|
||||
const noteContent = ref('');
|
||||
const profile = inject('profile');
|
||||
|
||||
async function onAckChecklistItem(item, key) {
|
||||
const [error] = await appsModel.ackChecklistItem(id.value, key, true);
|
||||
if (error) return console.error(error);
|
||||
|
||||
item.acknowledged = true;
|
||||
item.changedAt = Date.now();
|
||||
item.changedBy = profile.value.username;
|
||||
hasOldChecklist.value = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user