Added actor creation page.
This commit is contained in:
20
pages/actors/edit/+route.js
Normal file
20
pages/actors/edit/+route.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// 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;
|
||||
};
|
||||
Reference in New Issue
Block a user