From f6677886c32e46c52f905611918c31082b9c4da3 Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Wed, 6 Sep 2023 16:58:04 +0200 Subject: [PATCH] docs: Write docs about the relations feature --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 53e9a82..be43f24 100644 --- a/README.md +++ b/README.md @@ -322,6 +322,30 @@ If you do not have a single unique value, you can also pass in a array of keys f > `required:` YES | `type:` string | string[] +#### Relations + +The relations array specifies the relations you want to include in the sync process. +This feature is used to sync the relations between `roles` and `permissions`. See https://github.com/boazpoolman/strapi-plugin-config-sync/blob/master/server/config/types.js#L16. + +Example: +``` +{ + configName: 'admin-role', + queryString: 'admin::role', + uid: 'code', + relations: [{ + queryString: 'admin::permission', + relationName: 'permissions', + parentName: 'role', + relationSortFields: ['action', 'subject'], + }], +}, +``` + +###### Key: `relations` + +> `required:` NO | `type:` array + #### JSON fields This property can accept an array of field names from the type. It is meant to specify the JSON fields on the type so the plugin can better format the field values when calculating the config difference.