RLH-18 | Implement Account rename APIs
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -40,3 +40,6 @@ testem.log
|
|||||||
# System files
|
# System files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
.nx/cache
|
||||||
|
.nx/workspace-data
|
||||||
|
|||||||
16
src/app/services/account.service.spec.ts
Normal file
16
src/app/services/account.service.spec.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AccountService } from './account.service';
|
||||||
|
|
||||||
|
describe('AccountService', () => {
|
||||||
|
let service: AccountService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(AccountService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
27
src/app/services/account.service.ts
Normal file
27
src/app/services/account.service.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import {HttpClient} from "@angular/common/http";
|
||||||
|
import {UserData} from "../interface/user";
|
||||||
|
import {Observable} from "rxjs";
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class AccountService {
|
||||||
|
|
||||||
|
private apiUrl = 'http://localhost:8080/api/';
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private http: HttpClient
|
||||||
|
) {}
|
||||||
|
|
||||||
|
// v1 ACCOUNT
|
||||||
|
changeUsername(uuid: string, username: string): Observable<string> {
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
uuid: uuid,
|
||||||
|
username: username
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.http.post<string>(this.apiUrl + 'v1/account/edit', body);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user