Skip to content

Commit

Permalink
feat(redirects): Added redirects schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexnortung committed Aug 24, 2023
1 parent c144fbd commit c72e48a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
44 changes: 44 additions & 0 deletions server/admin-api/content-types/redirect/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"kind": "collectionType",
"collectionName": "redirects",
"info": {
"singularName": "redirect",
"pluralName": "redirects",
"displayName": "Redirect"
},
"options": {
"draftAndPublish": false,
"comment": ""
},
"pluginOptions": {
"content-manager": {
"visible": false
},
"content-type-builder": {
"visible": false
}
},
"attributes": {
"from_path": {
"type": "relation",
"relation": "oneToOne",
"target": "plugin::url-alias.path",
"required": true,
"unique": true
},
"to_path": {
"type": "relation",
"relation": "oneToOne",
"target": "plugin::url-alias.path"
},
"to_url": {
"type": "string"
},
"redirect_type": {
"type": "enumeration",
"enum": ["permanent", "temporary"],
"required": true,
"default": "permanent"
}
}
}
4 changes: 4 additions & 0 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import adminApiRegister from "./admin-api/register";
import adminApiBootstrap from "./admin-api/bootstrap";
import adminApiPathSchema from "./admin-api/content-types/path/schema.json";
import adminApiPatternSchema from "./admin-api/content-types/pattern/schema.json";
import adminApiRedirectSchema from "./admin-api/content-types/redirect/schema.json";
import adminApiPathController from "./admin-api/controllers/path";
import adminApiPatternController from "./admin-api/controllers/pattern";
import adminApiInfoController from "./admin-api/controllers/info";
Expand Down Expand Up @@ -39,6 +40,9 @@ export default {
pattern: {
schema: adminApiPatternSchema,
},
redirect: {
schema: adminApiRedirectSchema,
},
},
routes: {
admin: {
Expand Down

0 comments on commit c72e48a

Please sign in to comment.