(isRefresh = false, {priority = FOREGROUND_PRIORITY} = {})
| 58 | } |
| 59 | |
| 60 | export async function getRecords(isRefresh = false, {priority = FOREGROUND_PRIORITY} = {}) { |
| 61 | return await loadCachedValue({ |
| 62 | key: RECORDS_CACHE_KEY, |
| 63 | legacyFields: ["data"], |
| 64 | forceRefresh: isRefresh, |
| 65 | priority, |
| 66 | load: async () => { |
| 67 | const response = await apiJson(RECORD_LIST, { |
| 68 | fetchPriority: priority, |
| 69 | }); |
| 70 | return normalizeRecordList(response.data); |
| 71 | }, |
| 72 | }) ?? {}; |
| 73 | } |
| 74 | |
| 75 | export async function setRecords(records) { |
| 76 | if (!records) { |
no test coverage detected