Update checklist item when acked directly in the frontend

This commit is contained in:
Johannes Zellner
2025-06-10 19:44:53 +02:00
parent 3d057781de
commit b37c0fbb95
2 changed files with 5 additions and 1 deletions

View File

@@ -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;
}