Added ability to set colead.
This commit is contained in:
parent
ecfbfcd53e
commit
940cf29d04
1 changed files with 13 additions and 0 deletions
|
|
@ -87,6 +87,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
async function toggleLead(v) {
|
||||
try {
|
||||
const updated = await api.volunteers.update(v.id, { ...v, is_lead: !v.is_lead })
|
||||
await db.volunteers.put(updated)
|
||||
} catch (err) {
|
||||
error = err.message
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteVolunteer(v) {
|
||||
if (!confirm(`Delete volunteer "${v.name}"?`)) return
|
||||
try {
|
||||
|
|
@ -243,6 +252,10 @@
|
|||
</td>
|
||||
{#if canManage}
|
||||
<td>
|
||||
<button class="btn btn-ghost btn-sm" onclick={() => toggleLead(v)}
|
||||
title={v.is_lead ? 'Remove lead' : 'Mark as lead'}>
|
||||
{v.is_lead ? 'Unlead' : 'Lead'}
|
||||
</button>
|
||||
<button class="btn btn-danger btn-sm" onclick={() => deleteVolunteer(v)}>Delete</button>
|
||||
</td>
|
||||
{/if}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue