slicing dashboard

This commit is contained in:
2024-07-15 21:39:12 +07:00
parent 4c2d40986e
commit 751c36209e
20 changed files with 221 additions and 133 deletions

View File

@@ -5,6 +5,7 @@ import { ToastrService } from "ngx-toastr";
import { jwtDecode } from "jwt-decode";
import { AuthService } from "src/app/_services/auth.service";
import { Router } from "@angular/router";
import * as _ from "lodash"
interface CustomJwtPayload {
exp: number;
scope: string;
@@ -30,7 +31,7 @@ export class ProfilInformationComponent {
storedData: any;
currentUser: any;
disableButton: boolean = false;
oldData: any;
url: any = "https://www.w3schools.com/howto/img_avatar.png";
fileSelected: any = null;
@@ -40,7 +41,22 @@ export class ProfilInformationComponent {
private toastr: ToastrService,
public logoutService: AuthService,
private router: Router
) {}
) {
this.authService._tabSelected.subscribe(res => {
console.log(res);
console.log(this.oldData);
console.log(this.profilInfo.value);
if (res === "update-password") {
if (this.oldData !== this.profilInfo.value) {
console.log('ada perubahan');
return false
} else {
console.log('tidak ada perubahan');
}
}
})
}
ngOnInit(): void {
this.storedData = JSON.parse(localStorage.getItem("account_info"));
@@ -69,6 +85,10 @@ export class ProfilInformationComponent {
phone: data.data.phone,
image: [null],
});
// this.oldData._.cloneDeep(this.profilInfo.value);
this.oldData = _.cloneDeep(this.profilInfo.value)
console.log(this.oldData);
if (
data.data.image_path !== "https://kapi.absys.ninja/hemat/image/null"
) {