init f0ckm
This commit is contained in:
13
src/inc/halls_cache.mjs
Normal file
13
src/inc/halls_cache.mjs
Normal file
@@ -0,0 +1,13 @@
|
||||
import db from "./sql.mjs";
|
||||
|
||||
let hallsCache = [];
|
||||
|
||||
export const updateHallsCache = async () => {
|
||||
try {
|
||||
hallsCache = await db`SELECT id, name, slug, rating FROM halls ORDER BY name ASC`;
|
||||
} catch (e) {
|
||||
console.error('[HALLS CACHE] Failed to update:', e);
|
||||
}
|
||||
};
|
||||
|
||||
export const getHalls = () => hallsCache;
|
||||
Reference in New Issue
Block a user