@@ -1,5 +1,5 @@
|
||||
import * as argon2 from "argon2";
|
||||
import { IsBoolean, IsOptional, IsString } from 'class-validator';
|
||||
import { IsOptional, IsString } from 'class-validator';
|
||||
import crypto from 'crypto';
|
||||
import * as uuid from 'uuid';
|
||||
import { StatsClient } from '../entities/StatsClient';
|
||||
@@ -15,13 +15,6 @@ export class CreateStatsClient {
|
||||
@IsOptional()
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* Is the new client enabled.
|
||||
*/
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
enabled?: boolean;
|
||||
|
||||
/**
|
||||
* Converts this to a StatsClient entity.
|
||||
*/
|
||||
@@ -35,9 +28,6 @@ export class CreateStatsClient {
|
||||
newClient.key = await argon2.hash(newClient.prefix + "." + newUUID);
|
||||
newClient.cleartextkey = newClient.prefix + "." + newUUID;
|
||||
|
||||
if (this.enabled === undefined || this.enabled === null) { newClient.enabled = true; }
|
||||
else { newClient.enabled = this.enabled }
|
||||
|
||||
return newClient;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user