user-profile > unlink account
This commit is contained in:
parent
dff8785e7b
commit
8be851763b
|
@ -50,7 +50,7 @@ public class RemoveCredentialRequestPersist {
|
|||
protected List<Specification> specifications(RemoveCredentialRequestPersist item) {
|
||||
return Arrays.asList(
|
||||
this.spec()
|
||||
.must(() -> !this.isValidGuid(item.getCredentialId()))
|
||||
.must(() -> this.isValidGuid(item.getCredentialId()))
|
||||
.failOn(RemoveCredentialRequestPersist._credentialId).failWith(messageSource.getMessage("Validation_Required", new Object[]{RemoveCredentialRequestPersist._credentialId}, LocaleContextHolder.getLocale()))
|
||||
);
|
||||
}
|
||||
|
|
|
@ -79,3 +79,7 @@ export interface DmpAssociatedUser {
|
|||
export interface UserMergeRequestPersist {
|
||||
email: string;
|
||||
}
|
||||
|
||||
export interface RemoveCredentialRequestPersist {
|
||||
credentialId: Guid;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { DmpAssociatedUser, User, UserMergeRequestPersist, UserPersist, UserRolePatchPersist } from '@app/core/model/user/user';
|
||||
import { DmpAssociatedUser, RemoveCredentialRequestPersist, User, UserMergeRequestPersist, UserPersist, UserRolePatchPersist } from '@app/core/model/user/user';
|
||||
import { UserLookup } from '@app/core/query/user.lookup';
|
||||
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||
|
@ -106,6 +106,16 @@ export class UserService {
|
|||
.post<boolean>(url, item).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
removeCredentialAccount(item: RemoveCredentialRequestPersist): Observable<boolean> {
|
||||
const url = `${this.apiBase}/mine/remove-credential-request`;
|
||||
console.log(item);
|
||||
console.log(url);
|
||||
|
||||
return this.http
|
||||
.post<boolean>(url, item).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
confirmMergeAccount(token: Guid): Observable<boolean> {
|
||||
const url = `${this.apiBase}/mine/confirm-merge-account/token/${token}`;
|
||||
|
|
|
@ -296,8 +296,13 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
|
|||
.afterClosed()
|
||||
.subscribe(confirm => {
|
||||
if (confirm) {
|
||||
|
||||
this.userService.removeCredentialAccount({ credentialId: userCredential.user.id }).subscribe(result => {
|
||||
//TODO
|
||||
},
|
||||
error => console.error(error));
|
||||
|
||||
//TODO: refactor
|
||||
console.log('removed!');
|
||||
// const unlinkAccountModel: UnlinkAccountRequestModel = {
|
||||
// userId: this.currentUserId,
|
||||
// email: userCredential.email,
|
||||
|
|
Loading…
Reference in New Issue