ui phase 8

This commit is contained in:
hamid
2026-07-19 13:57:11 +03:30
parent edc38543fd
commit 1ef4feb911
41 changed files with 2113 additions and 667 deletions
@@ -107,4 +107,13 @@ export const profilesClientApi: ProfilesApi = {
}),
);
},
// ui-phase-8: the real, previously-unwired go-live switch — flips `is_accepting_bookings`
// independently of `is_verified`; the server reindexes the nurse's search rows in-transaction.
setAcceptingBookings: async (accepting: boolean): Promise<void> => {
await clientFetch<ApiEnvelope<boolean>>(`${BASE}/nurse_profiles/set_accepting_bookings`, {
method: 'POST',
body: JSON.stringify({ accepting }),
});
},
};
@@ -70,4 +70,11 @@ export const profilesMockApi: ProfilesApi = {
// object-storage URL (REQ-006).
return { url: URL.createObjectURL(file) };
},
// Mirrors the real endpoint's flip: `isVerified` is never touched, matching the guarded server field.
setAcceptingBookings: async (accepting: boolean): Promise<void> => {
await sleep(MOCK_LATENCY_MS);
if (!nurseProfile) return;
nurseProfile = { ...nurseProfile, isAcceptingBookings: accepting };
},
};