Skip to content

Commit b6b59ff

Browse files
committed
Added member commenting schema for comment moderation
ref https://linear.app/ghost/issue/FEA-487 - Added `can_comment` (boolean) to member properties - Added `commenting` property to member with `member-commenting` definition: - `disabled` (boolean, required) - `disabled_reason` (string, minLength: 1, maxLength: 2000) - `disabled_until` (string|null, format: date-time) - Added `member_commenting.json` base schema for disable endpoint - Added `member_commenting-disable.json` schema for `/members/:id/commenting` endpoint
1 parent a5b249c commit b6b59ff

6 files changed

Lines changed: 32 additions & 50 deletions

File tree

packages/admin-api-schema/lib/schemas/comment_bans-add.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

packages/admin-api-schema/lib/schemas/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = [
2-
'comment_bans-add',
2+
'member_commenting-disable',
33
'images-upload',
44
'media-upload',
55
'labels-add',
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "member_commenting.disable",
4+
"title": "member_commenting.disable",
5+
"description": "Schema for member_commenting.disable",
6+
"allOf": [{ "$ref": "member_commenting#/definitions/member_commenting" }]
7+
}

packages/admin-api-schema/lib/schemas/comment_bans.json renamed to packages/admin-api-schema/lib/schemas/member_commenting.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "comment_bans",
4-
"title": "comment_bans",
5-
"description": "Base comment_bans definitions",
3+
"$id": "member_commenting",
4+
"title": "member_commenting",
5+
"description": "Base member_commenting definitions",
66
"definitions": {
7-
"comment_ban": {
7+
"member_commenting": {
88
"type": "object",
99
"additionalProperties": false,
1010
"properties": {

packages/admin-api-schema/lib/schemas/members-edit.json

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,8 @@
5454
"can_comment": {
5555
"type": "boolean"
5656
},
57-
"comment_ban": {
58-
"oneOf": [
59-
{
60-
"type": "object",
61-
"additionalProperties": false,
62-
"properties": {
63-
"reason": { "type": "string", "minLength": 1, "maxLength": 2000 },
64-
"expires_at": { "type": ["string", "null"], "format": "date-time" }
65-
},
66-
"required": ["reason"]
67-
},
68-
{ "type": "null" }
69-
]
57+
"commenting": {
58+
"$ref": "members#/definitions/member-commenting"
7059
}
7160
}
7261
}

packages/admin-api-schema/lib/schemas/members.json

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,8 @@
5151
"can_comment": {
5252
"type": "boolean"
5353
},
54-
"comment_ban": {
55-
"oneOf": [
56-
{
57-
"type": "object",
58-
"additionalProperties": false,
59-
"properties": {
60-
"reason": { "type": "string", "minLength": 1, "maxLength": 2000 },
61-
"expires_at": { "type": ["string", "null"], "format": "date-time" }
62-
},
63-
"required": ["reason"]
64-
},
65-
{ "type": "null" }
66-
]
54+
"commenting": {
55+
"$ref": "#/definitions/member-commenting"
6756
}
6857
}
6958
},
@@ -163,6 +152,22 @@
163152
}
164153
]
165154
}
155+
},
156+
"member-commenting": {
157+
"description": "Commenting status of the member",
158+
"oneOf": [
159+
{
160+
"type": "object",
161+
"additionalProperties": false,
162+
"properties": {
163+
"disabled": { "type": "boolean" },
164+
"disabled_reason": { "type": "string", "minLength": 1, "maxLength": 2000 },
165+
"disabled_until": { "type": ["string", "null"], "format": "date-time" }
166+
},
167+
"required": ["disabled"]
168+
},
169+
{ "type": "null" }
170+
]
166171
}
167172
}
168173
}

0 commit comments

Comments
 (0)