merge feature/sse-reads: SSE reactivity + claim flow + platform admin
This commit is contained in:
@@ -468,18 +468,7 @@
|
||||
{#each todays as c}
|
||||
<li>
|
||||
✅ {choreNameFor(c.assignedChoreId)}
|
||||
<form
|
||||
method="POST"
|
||||
action="?/revoke"
|
||||
use:enhance={() => {
|
||||
return async (args) =>
|
||||
handleResult(args, (d) => {
|
||||
if (d.revoked)
|
||||
famStore.applyRecord('completions', { id: d.id }, 'delete');
|
||||
});
|
||||
}}
|
||||
class="revoke-form"
|
||||
>
|
||||
<form method="POST" action="?/revoke" use:enhance={() => { return async (args) => handleResult(args); }} class="revoke-form">
|
||||
<input type="hidden" name="id" value={c.id} />
|
||||
<button type="submit" class="revoke-btn" title="Revoke">↩</button>
|
||||
</form>
|
||||
@@ -511,18 +500,7 @@
|
||||
<span class="trigger-value">{val}</span>
|
||||
</div>
|
||||
{#if targeted}
|
||||
<form
|
||||
method="POST"
|
||||
action="?/trigger"
|
||||
use:enhance={() => {
|
||||
return async (args: any) =>
|
||||
handleResult(args, (d: any) => {
|
||||
if (d.records) {
|
||||
d.records.forEach((r: any) => famStore.applyRecord('rewards', r, 'create'));
|
||||
}
|
||||
});
|
||||
}}
|
||||
>
|
||||
<form method="POST" action="?/trigger" use:enhance={() => { return async (args: any) => handleResult(args); }}>
|
||||
<input type="hidden" name="configId" value={bc.id} />
|
||||
<input type="hidden" name="memberId" value={targeted.id} />
|
||||
<div class="trigger-row">
|
||||
@@ -533,18 +511,7 @@
|
||||
</div>
|
||||
</form>
|
||||
{:else}
|
||||
<form
|
||||
method="POST"
|
||||
action="?/trigger"
|
||||
use:enhance={() => {
|
||||
return async (args: any) =>
|
||||
handleResult(args, (d: any) => {
|
||||
if (d.records) {
|
||||
d.records.forEach((r: any) => famStore.applyRecord('rewards', r, 'create'));
|
||||
}
|
||||
});
|
||||
}}
|
||||
>
|
||||
<form method="POST" action="?/trigger" use:enhance={() => { return async (args: any) => handleResult(args); }}>
|
||||
<input type="hidden" name="configId" value={bc.id} />
|
||||
<div class="trigger-row">
|
||||
<select name="memberId" class="trigger-select">
|
||||
@@ -584,12 +551,7 @@
|
||||
method="POST"
|
||||
action="?/claim"
|
||||
use:enhance={() => {
|
||||
return async (args: any) =>
|
||||
handleResult(args, (d: any) => {
|
||||
if (d.record) {
|
||||
famStore.applyRecord('rewards', d.record, 'update');
|
||||
}
|
||||
});
|
||||
return async (args: any) => handleResult(args);
|
||||
}}
|
||||
>
|
||||
<input type="hidden" name="id" value={r.id} />
|
||||
@@ -599,7 +561,6 @@
|
||||
<div class="payment-right">
|
||||
<span class="value">{rewardLabel(r)}</span>
|
||||
<Button type="submit" size="sm" variant="primary">Issue</Button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{/each}
|
||||
|
||||
Reference in New Issue
Block a user