mirror of https://github.com/abpframework/abp.git
1 changed files with 35 additions and 0 deletions
@ -0,0 +1,35 @@ |
|||||
|
import type { ChangePasswordInput, ProfileDto, UpdateProfileDto } from './models'; |
||||
|
import { RestService } from '@abp/ng.core'; |
||||
|
import { Injectable } from '@angular/core'; |
||||
|
|
||||
|
@Injectable({ |
||||
|
providedIn: 'root', |
||||
|
}) |
||||
|
export class ProfileService { |
||||
|
apiName = 'AbpAccount'; |
||||
|
|
||||
|
changePassword = (input: ChangePasswordInput) => |
||||
|
this.restService.request<any, void>({ |
||||
|
method: 'POST', |
||||
|
url: '/api/account/my-profile/change-password', |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
get = () => |
||||
|
this.restService.request<any, ProfileDto>({ |
||||
|
method: 'GET', |
||||
|
url: '/api/account/my-profile', |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
update = (input: UpdateProfileDto) => |
||||
|
this.restService.request<any, ProfileDto>({ |
||||
|
method: 'PUT', |
||||
|
url: '/api/account/my-profile', |
||||
|
body: input, |
||||
|
}, |
||||
|
{ apiName: this.apiName }); |
||||
|
|
||||
|
constructor(private restService: RestService) {} |
||||
|
} |
||||
Loading…
Reference in new issue