13 lines
294 B
JavaScript
13 lines
294 B
JavaScript
import { HttpError } from '../errors.js';
|
|
import { initCaches } from '../cache.js';
|
|
|
|
export async function initCachesApi(req, res) {
|
|
if (req.user?.role !== 'admin') {
|
|
throw new HttpError('You must be an admin to initialize caches', 404);
|
|
}
|
|
|
|
await initCaches();
|
|
|
|
res.status(204).send();
|
|
}
|