diff --git a/frontend/main/src/app/about/about.component.html b/frontend/main/src/app/about/about.component.html
index f73f66a..1ad7231 100644
--- a/frontend/main/src/app/about/about.component.html
+++ b/frontend/main/src/app/about/about.component.html
@@ -8,10 +8,10 @@
Frontend Dev.
+
-
+
-
+
-
- Password:
+
@@ -46,6 +46,6 @@
Edit your information
\ No newline at end of file
diff --git a/frontend/main/src/app/edit/edit.component.ts b/frontend/main/src/app/edit/edit.component.ts
index 5fba7ea..7c0e0ca 100644
--- a/frontend/main/src/app/edit/edit.component.ts
+++ b/frontend/main/src/app/edit/edit.component.ts
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
+import { LoginserviceService } from '../loginservice.service';
@Component({
selector: 'app-edit',
@@ -18,15 +19,25 @@ password!:string
constructor(
- private router:Router
+ private router:Router,
+ private login: LoginserviceService
) { }
ngOnInit(): void {
+
+this.user= this.login.user
+this.name= this.login.nome
+this.birth= this.login.birth
+this.document= this.login.document
+this.email= this.login.email
+this.password = this.login.password
+
}
- alterar(index:number){
+ alterar(){
+ alert("Funcionou!!!")
//this.edit.splice()
}
diff --git a/frontend/main/src/app/loginservice.service.ts b/frontend/main/src/app/loginservice.service.ts
index 53cdae3..32a64b6 100644
--- a/frontend/main/src/app/loginservice.service.ts
+++ b/frontend/main/src/app/loginservice.service.ts
@@ -11,20 +11,25 @@ import { LoginComponent } from './login/login.component';
export class LoginserviceService implements CanActivate {
readonly TMSLoginAPI: string = "http://localhost:8080"
- readonly APIBounceInit:string = "http://localhost:8080/login/init"
+ readonly APIBounceInit: string = "http://localhost:8080/login/init"
nome!: string
+ user!: string
+ email!: string
+ password!: string
+ birth!: Date
+ document!: string
succeed!: boolean
progress!: boolean
- admin!:boolean
- enterprise!:boolean
+ admin!: boolean
+ enterprise!: boolean
+ pessoaID!: number
adminEnter:boolean = false
- pessoaID!:number
- idBounce!:number
- userBounce!:string
- dateBounce!:string
- timeBounce!:string
+ idBounce!: number
+ userBounce!: string
+ dateBounce!: string
+ timeBounce!: string
constructor(private router: Router, private http: HttpClient) { }
@@ -32,9 +37,9 @@ export class LoginserviceService implements CanActivate {
this.progress = true
- let build:any = {
- 'user':user,
- 'senha':password
+ let build: any = {
+ 'user': user,
+ 'senha': password
}
this.http.post(this.TMSLoginAPI +'/login', build)
@@ -69,50 +74,53 @@ export class LoginserviceService implements CanActivate {
console.log(resp);
this.nome = resp.nome
this.pessoaID = response[0].pessoa_id
+ this.birth = resp.birth
+ this.document = resp.document
+ this.email = resp.email
+ this.password = response[0].senha
})
+
+ let bounce: any = {
+ "user": response[0].user
+ }
- let bounce:any = {
- "user":response[0].user
- }
-
- this.http.post(this.APIBounceInit, bounce)
- .subscribe((response:any)=>{
- console.log(response);
- this.idBounce = response.id
- this.userBounce = response.user
- this.dateBounce = response.date
- this.timeBounce = response.time
+ this.http.post(this.APIBounceInit, bounce)
+ .subscribe((response: any) => {
+ console.log(response);
+ this.idBounce = response.id
+ this.userBounce = response.user
+ this.dateBounce = response.date
+ this.timeBounce = response.time
+ })
})
-
- })
}
- registering(name:string ,user: string, email: string, password: string) {
+ registering(name: string, user: string, email: string, password: string) {
this.progress = true
- let build:any = {
- 'nome':name,
- 'user':user,
- 'email':email,
- 'senha':password
+ let build: any = {
+ 'nome': name,
+ 'user': user,
+ 'email': email,
+ 'senha': password
}
- let buildLogin:any = {
- 'user':user,
- 'senha':password
+ let buildLogin: any = {
+ 'user': user,
+ 'senha': password
}
- this.http.post(this.TMSLoginAPI+'/register', build)
- .pipe(
- catchError((error)=>{
- return error
+ this.http.post(this.TMSLoginAPI + '/register', build)
+ .pipe(
+ catchError((error) => {
+ return error
+ })
+ )
+ .subscribe((response) => {
+ buildLogin = response
+ return buildLogin
})
- )
- .subscribe((response)=>{
- buildLogin = response
- return buildLogin
- })
return buildLogin