21 lines
522 B
JavaScript
21 lines
522 B
JavaScript
// export default '/actor/edit/@actorId/*';
|
|
// import { redirect } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
|
import { match } from 'path-to-regexp';
|
|
|
|
const path = '/actor/(edit|new)/:actorId?/:actorSlug?';
|
|
const urlMatch = match(path, { decode: decodeURIComponent });
|
|
|
|
export default (pageContext) => {
|
|
const matched = urlMatch(pageContext.urlPathname);
|
|
|
|
if (matched) {
|
|
return {
|
|
routeParams: matched.params.actorId ? {
|
|
actorId: matched.params.actorId,
|
|
} : {},
|
|
};
|
|
}
|
|
|
|
return false;
|
|
};
|