feat: email auth provider disabled on smtp disable

This commit is contained in:
mirarifhasan
2024-05-27 13:02:01 +06:00
parent bcaed7ec69
commit 8b14f77d78
2 changed files with 60 additions and 0 deletions

View File

@@ -367,4 +367,23 @@ export class InfraResolver {
return true;
}
@Mutation(() => Boolean, {
description: 'Enable or Disable SMTP for sending emails',
})
@UseGuards(GqlAuthGuard, GqlAdminGuard)
async enableAndDisableSMTP(
@Args({
name: 'status',
type: () => ServiceStatus,
description: 'Toggle SMTP',
})
status: ServiceStatus,
) {
const isUpdated = await this.infraConfigService.enableAndDisableSMTP(
status,
);
if (E.isLeft(isUpdated)) throwErr(isUpdated.left);
return true;
}
}