fix: 进一步标准化
This commit is contained in:
1 parent
74acdd6433
commit
433ad9b06f
1 file changed
+2
-2
@@ -12,7 +12,7 @@ const SchemaData = {
|
|||||||
approve: { type: 'boolean' },
|
approve: { type: 'boolean' },
|
||||||
reason: { type: 'string' }
|
reason: { type: 'string' }
|
||||||
},
|
},
|
||||||
required: ['flag', 'approve']
|
required: ['flag']
|
||||||
} as const satisfies JSONSchema;
|
} as const satisfies JSONSchema;
|
||||||
|
|
||||||
type Payload = FromSchema<typeof SchemaData>;
|
type Payload = FromSchema<typeof SchemaData>;
|
||||||
@@ -22,7 +22,7 @@ export default class SetGroupAddRequest extends BaseAction<Payload, null> {
|
|||||||
PayloadSchema = SchemaData;
|
PayloadSchema = SchemaData;
|
||||||
protected async _handle(payload: Payload): Promise<null> {
|
protected async _handle(payload: Payload): Promise<null> {
|
||||||
const flag = payload.flag.toString();
|
const flag = payload.flag.toString();
|
||||||
const approve = payload.approve.toString() === 'true';
|
const approve = payload.approve?.toString() === 'true';
|
||||||
const notify = groupNotifies[flag];
|
const notify = groupNotifies[flag];
|
||||||
if (!notify) {
|
if (!notify) {
|
||||||
throw `${flag}对应的加群通知不存在`;
|
throw `${flag}对应的加群通知不存在`;
|
||||||
|
|||||||
Reference in new issue
Block a user