ui phase 8
This commit is contained in:
@@ -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 };
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user