Updated Participant search and delete. Filtered import.
This commit is contained in:
parent
219acb62d6
commit
64ce97c74d
3 changed files with 30 additions and 9 deletions
|
|
@ -53,7 +53,8 @@
|
|||
.filter(p => {
|
||||
if (!s) return true
|
||||
return p.preferred_name?.toLowerCase().includes(s) ||
|
||||
p.email?.toLowerCase().includes(s)
|
||||
p.email?.toLowerCase().includes(s) ||
|
||||
p.phone?.toLowerCase().includes(s)
|
||||
})
|
||||
.sort((a, b) => (a.preferred_name || a.email).localeCompare(b.preferred_name || b.email))
|
||||
})
|
||||
|
|
@ -177,6 +178,18 @@
|
|||
}
|
||||
}
|
||||
|
||||
async function deleteParticipant(id) {
|
||||
if (!confirm('Permanently delete this participant and all their records?')) return
|
||||
error = ''
|
||||
try {
|
||||
await api.participants.delete(id)
|
||||
await db.participants.delete(id)
|
||||
editId = null
|
||||
} catch (err) {
|
||||
error = err.message
|
||||
}
|
||||
}
|
||||
|
||||
async function addTicket(e, participantId) {
|
||||
e.preventDefault()
|
||||
addingTicket = true; error = ''
|
||||
|
|
@ -327,6 +340,8 @@
|
|||
<div class="actions" style="margin-top:0.5rem">
|
||||
<button type="submit" class="btn btn-primary btn-sm" disabled={saving}>{saving ? 'Saving…' : 'Save'}</button>
|
||||
<button type="button" class="btn btn-ghost btn-sm" onclick={() => editId = null}>Cancel</button>
|
||||
<span class="spacer"></span>
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick={() => deleteParticipant(editId)}>Delete</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue