Added Backend for User Profile
This commit is contained in:
@@ -34,3 +34,13 @@ export class TfaSetup extends BaseRequest {
|
||||
@IsBoolean()
|
||||
mail: boolean;
|
||||
}
|
||||
|
||||
export class ChangePasswordRequest extends BaseRequest {
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
oldPassword: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
@@ -35,4 +35,5 @@ export class RemoveTfaResponse extends SuccessResponse {}
|
||||
export class RequestEmailTfaResponse extends SuccessResponse {}
|
||||
export class TfaCompletedResponse extends SuccessResponse {}
|
||||
export class SignupResponse extends SuccessResponse {}
|
||||
export class ChangePasswordResponse extends SuccessResponse {}
|
||||
export class RefreshResponse extends LoginResponse {}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './base';
|
||||
export * as Auth from './auth';
|
||||
export * as FS from './fs';
|
||||
export * as User from './user';
|
||||
|
||||
27
dto/src/responses/user.ts
Normal file
27
dto/src/responses/user.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { SuccessResponse } from './base';
|
||||
import { ValidateConstructor } from '../utils';
|
||||
import { IsBoolean, IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
@ValidateConstructor
|
||||
export class UserInfoResponse extends SuccessResponse {
|
||||
constructor(name: string, gitlab: boolean, tfaEnabled: boolean) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.gitlab = gitlab;
|
||||
this.tfaEnabled = tfaEnabled;
|
||||
}
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@IsBoolean()
|
||||
gitlab: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
tfaEnabled: boolean;
|
||||
}
|
||||
|
||||
export class DeleteUserResponse extends SuccessResponse {}
|
||||
export class ChangePasswordResponse extends SuccessResponse {}
|
||||
export class LogoutAllResponse extends SuccessResponse {}
|
||||
Reference in New Issue
Block a user