main
js 14 lines 332 Bytes
Raw
1 import { clear } from "/js/cache.js";
2
3 export default async function resetCache(ctx) {
4 try {
5 // clear frontend cache areas when backend caches are cleared via API
6 if (ctx.endpoint == "cache_reset") {
7 for (const area of ctx.data.areas) {
8 clear(area);
9 }
10 }
11 } catch (e) {
12 console.error(e);
13 }
14 }