summaryrefslogtreecommitdiff
path: root/playground/src/api/author
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-02-05 13:19:56 +0300
committerValentin Popov <valentin@popov.link>2026-02-05 13:19:56 +0300
commitefa89313fa4152252b477aafd88f7cf4a66747d8 (patch)
tree5939b251fe1bbc6bea3881a71154cabd3aa538ec /playground/src/api/author
parentf6de8611955bf382612996500efba21a2d64ea1f (diff)
downloadstrapi-plugin-checkbox-list-efa89313fa4152252b477aafd88f7cf4a66747d8.tar.xz
strapi-plugin-checkbox-list-efa89313fa4152252b477aafd88f7cf4a66747d8.zip
Initial Strapi plugin project
Diffstat (limited to 'playground/src/api/author')
-rw-r--r--playground/src/api/author/content-types/author/schema.json34
-rw-r--r--playground/src/api/author/controllers/author.ts7
-rw-r--r--playground/src/api/author/routes/author.ts7
-rw-r--r--playground/src/api/author/services/author.ts7
4 files changed, 55 insertions, 0 deletions
diff --git a/playground/src/api/author/content-types/author/schema.json b/playground/src/api/author/content-types/author/schema.json
new file mode 100644
index 0000000..a202482
--- /dev/null
+++ b/playground/src/api/author/content-types/author/schema.json
@@ -0,0 +1,34 @@
+{
+ "kind": "collectionType",
+ "collectionName": "authors",
+ "info": {
+ "singularName": "author",
+ "pluralName": "authors",
+ "displayName": "Author",
+ "description": "Create authors for your content"
+ },
+ "options": {
+ "draftAndPublish": false
+ },
+ "pluginOptions": {},
+ "attributes": {
+ "name": {
+ "type": "string"
+ },
+ "avatar": {
+ "type": "media",
+ "multiple": false,
+ "required": false,
+ "allowedTypes": ["images", "files", "videos"]
+ },
+ "email": {
+ "type": "string"
+ },
+ "articles": {
+ "type": "relation",
+ "relation": "oneToMany",
+ "target": "api::article.article",
+ "mappedBy": "author"
+ }
+ }
+}
diff --git a/playground/src/api/author/controllers/author.ts b/playground/src/api/author/controllers/author.ts
new file mode 100644
index 0000000..2649762
--- /dev/null
+++ b/playground/src/api/author/controllers/author.ts
@@ -0,0 +1,7 @@
+/**
+ * author controller
+ */
+
+import { factories } from '@strapi/strapi';
+
+export default factories.createCoreController('api::author.author');
diff --git a/playground/src/api/author/routes/author.ts b/playground/src/api/author/routes/author.ts
new file mode 100644
index 0000000..10475e7
--- /dev/null
+++ b/playground/src/api/author/routes/author.ts
@@ -0,0 +1,7 @@
+/**
+ * author router.
+ */
+
+import { factories } from '@strapi/strapi';
+
+export default factories.createCoreRouter('api::author.author');
diff --git a/playground/src/api/author/services/author.ts b/playground/src/api/author/services/author.ts
new file mode 100644
index 0000000..16f75eb
--- /dev/null
+++ b/playground/src/api/author/services/author.ts
@@ -0,0 +1,7 @@
+/**
+ * author service.
+ */
+
+import { factories } from '@strapi/strapi';
+
+export default factories.createCoreService('api::author.author');