fix socket checkin
This commit is contained in:
@@ -447,6 +447,22 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Global fetcher for all patients across all available lokets
|
||||
*/
|
||||
const fetchAllPatients = async () => {
|
||||
console.log('🔄 [queueStore] Fetching all patients for all lokets...');
|
||||
const allLokets = loketStore.lokets || [];
|
||||
if (allLokets.length === 0) {
|
||||
console.warn('⚠️ [queueStore] No lokets available for fetchAllPatients');
|
||||
return;
|
||||
}
|
||||
|
||||
// Use Promise.all for faster fetching
|
||||
await Promise.all(allLokets.map(l => fetchPatientsForLoket(l.id)));
|
||||
console.log(`✅ [queueStore] All patients fetched. Total: ${allPatients.value.length}`);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get patients for a specific loket (from API or seed data based on loket type)
|
||||
*/
|
||||
@@ -2549,6 +2565,7 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
|
||||
// API Patient Actions
|
||||
fetchPatientsForLoket,
|
||||
fetchAllPatients,
|
||||
getPatientsForLoket,
|
||||
mapStatusFromDeskripsi,
|
||||
mapApiPatientToStoreFormat,
|
||||
|
||||
Reference in New Issue
Block a user