19 lines
369 B
JavaScript
19 lines
369 B
JavaScript
import { render } from 'vike/abort';
|
|
|
|
import { listEmailTemplates } from '#/src/email-templates.js';
|
|
|
|
export default function onBeforeRender(pageContext) {
|
|
if (!pageContext.user || pageContext.user.role === 'user') {
|
|
throw render(404);
|
|
}
|
|
|
|
return {
|
|
pageContext: {
|
|
title: 'E-mail Previews',
|
|
pageProps: {
|
|
templates: listEmailTemplates(),
|
|
},
|
|
},
|
|
};
|
|
}
|