19 lines
348 B
JavaScript
19 lines
348 B
JavaScript
import { match } from 'path-to-regexp';
|
|
|
|
const path = '/admin/emails/:template';
|
|
const urlMatch = match(path, { decode: decodeURIComponent });
|
|
|
|
export default (pageContext) => {
|
|
const matched = urlMatch(pageContext.urlPathname);
|
|
|
|
if (matched) {
|
|
return {
|
|
routeParams: {
|
|
template: matched.params.template,
|
|
},
|
|
};
|
|
}
|
|
|
|
return false;
|
|
};
|