fix socket checkin

This commit is contained in:
Fanrouver
2026-02-10 10:10:56 +07:00
parent fb70237a12
commit e686ddad57
2 changed files with 32 additions and 0 deletions
+17
View File
@@ -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,