Skip to content

Commit 8b856ac

Browse files
authored
Enumerate options for moderation case resolve admin action. (#7994)
1 parent cb5f8d9 commit 8b856ac

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

app/lib/admin/actions/moderation_case_resolve.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ Closes the moderation case and updates the status based on the actions logged on
1717
''',
1818
options: {
1919
'case': 'The caseId to be closed.',
20-
'status': 'The resolved status of the case. '
21-
'(optional, will be automatically inferred if absent)',
20+
'status': 'The resolved status of the case '
21+
'(optional, will be automatically inferred if absent). '
22+
'One of: ${ModerationStatus.resolveValues.join(', ')}.',
2223
'grounds': 'The grounds for the moderation actions '
23-
'(if moderation action was taken).',
24+
'(if moderation action was taken). '
25+
'One of: ${ModerationGrounds.resolveValues.join(', ')}.',
2426
'violation': 'The high-level category of the violation reason '
25-
'(if moderation action was taken).',
27+
'(if moderation action was taken). '
28+
'One of: ${ModerationViolation.violationValues.join(', ')}.',
2629
'reason': 'The text from SOR statement sent to the user '
2730
'(if moderation action was taken).',
2831
},
@@ -90,7 +93,7 @@ Closes the moderation case and updates the status based on the actions logged on
9093
InvalidInputException.checkAnyOf(
9194
grounds,
9295
'grounds',
93-
[ModerationGrounds.illegal, ModerationGrounds.policy],
96+
ModerationGrounds.resolveValues,
9497
);
9598

9699
InvalidInputException.checkNotNull(violation, 'violation');

app/lib/admin/models.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ abstract class ModerationGrounds {
257257
static const none = 'none';
258258
static const illegal = 'illegal';
259259
static const policy = 'policy';
260+
261+
static final resolveValues = [
262+
illegal,
263+
policy,
264+
];
260265
}
261266

262267
abstract class ModerationViolation {

0 commit comments

Comments
 (0)