optimize post migration

This commit is contained in:
JCEEE
2026-08-17 07:41:58 +01:00
parent 5204e7bdbc
commit fb18593ac5
17 changed files with 121 additions and 132 deletions
@@ -212,7 +212,7 @@
if (secondsLeft > 0 || eowFired) return;
if (!pbToken || !famId) return;
eowFired = true;
memberApi.payday(pbToken, famId).catch(() => {});
memberApi.payday(famId).catch(() => {});
});
function paydayWeekStart(): string {
@@ -546,7 +546,7 @@
}
try {
await memberApi.toggleCompletion(pbToken, famId, chore.id, todayChild);
await memberApi.toggleCompletion(famId, chore.id, todayChild);
const optimistic = completions.find((c) => c.id === 'optimistic-' + chore.id);
if (optimistic) {
famStore.applyRecord('completions', optimistic, 'delete');
@@ -960,14 +960,11 @@
const old = memberName;
memberName = nameInput;
try {
const res = await fetch('/api/members/me', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${pbToken}`
},
body: JSON.stringify({ name: nameInput })
});
const res = await fetch('/api/members', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: nameInput })
});
if (!res.ok) memberName = old;
} catch {
memberName = old;
@@ -1022,14 +1019,11 @@
memberColor = color;
showColorPicker = false;
try {
const res = await fetch('/api/members/me', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${pbToken}`
},
body: JSON.stringify({ color })
});
const res = await fetch('/api/members', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ color })
});
if (!res.ok) memberColor = old;
} catch {
memberColor = old;
@@ -1253,7 +1247,7 @@
class="wr-cta"
onclick={async () => {
try {
await memberApi.claimReward(pbToken, famId, r.id);
await memberApi.claimReward(famId, r.id);
} catch (e) {
claimError = e instanceof Error ? e.message : 'Claim failed';
}