Commit 98edb4ff by muhsin

added dob,

parent c56c1ad8
......@@ -17,20 +17,34 @@
<input
[(value)]="userData && userData.name"
name="name"
required
readonly
class=""
type="text"
[(ngModel)]="userData && userData.name"
placeholder="Change your Name"
#name="ngModel"
/>
<div
<!-- <div
class="md-errors-spacer"
[hidden]="name.valid"
class="ion-padding-start"
>
Name is required
</div>
</div> -->
</div>
<div class="row">
<input
[(value)]="userData && userData.dob"
name="dob"
readonly
class=""
type="text"
/>
<!-- <div
class="md-errors-spacer"
[hidden]="name.valid"
class="ion-padding-start"
>
Name is required
</div> -->
</div>
<div class="row">
<input
......@@ -122,7 +136,7 @@
<button
class="login_btn"
(click)="onFormSubmit(updateForm)"
[disabled]="!phone.valid || !name.valid"
[disabled]="!phone.valid "
>
UPDATE
</button>
......
......@@ -14,7 +14,7 @@ import { NgForm } from '@angular/forms';
export class ChangedetailsPage implements OnInit {
userData: any;
updateData: UpdateUserDetails = {
name: '',
phoneVerified: false,
phone: ''
};
confPasswordErr: string;
......@@ -65,7 +65,8 @@ export class ChangedetailsPage implements OnInit {
// Change Password
if (
form.value.currentPassword &&
form.value.password && form.value.password === form.value.confirmPassword
form.value.password &&
form.value.password === form.value.confirmPassword
) {
this.register.updateData(form.value, this.userData.uid);
this.register.updatePassword(
......
......@@ -23,12 +23,11 @@ import { Signup } from './../../config/services/user';
]
})
export class SignupPage implements OnInit {
menuShow = false;
currDate = new Date();
mobnumPattern = '(\(+61\)|\+61|\(0[1-9]\)|0[1-9])?( ?-?[0-9]){6,10}';
mobnumPattern = '((+61)|+61|(0[1-9])|0[1-9])?( ?-?[0-9]){6,10}';
minDate: any;
signup: Signup = {
signup: Signup = {
emailId: '',
name: '',
password: '',
......@@ -47,14 +46,19 @@ export class SignupPage implements OnInit {
console.log(this.currDate.getFullYear() - 10);
this.currDate.setFullYear(this.currDate.getFullYear() - 10);
console.log(this.currDate);
const month = this.currDate.getMonth() + 1 < 10 ? '0' + (this.currDate.getMonth() + 1) : '' + (this.currDate.getMonth() + 1),
day = this.currDate.getDate() < 10 ? '0' + this.currDate.getDate() : this.currDate.getDate(),
year = this.currDate.getFullYear();
const month =
this.currDate.getMonth() + 1 < 10
? '0' + (this.currDate.getMonth() + 1)
: '' + (this.currDate.getMonth() + 1),
day =
this.currDate.getDate() < 10
? '0' + this.currDate.getDate()
: this.currDate.getDate(),
year = this.currDate.getFullYear();
this.minDate = [year, month, day].join('-');
}
ngOnInit() {
}
ngOnInit() {}
goToPage(path, data = null) {
this.router.navigateByUrl(path, { queryParams: data });
......@@ -77,7 +81,4 @@ export class SignupPage implements OnInit {
this.register.signup(form.value);
}
}
}
......@@ -171,6 +171,7 @@ export class AuthService {
uid: value.uid,
emailId: value.emailId,
name: value.name,
dob: value.dob,
profilePhoto: value.profilePhoto,
emailVerified: value.emailVerified,
phone: value.phone,
......@@ -210,6 +211,7 @@ export class AuthService {
const postData: User = {
uid: userData.uid,
status: true,
dob: userData.dob ? userData.dob : '',
profilePhoto: userData.photoURL,
phoneVerified: false,
phone: userData.phoneNumber,
......@@ -247,8 +249,10 @@ export class AuthService {
symbol: 'A$'
};
const custData = result.user;
const dobDate = new Date(userData.dob);
const postData: User = {
uid: custData.uid,
dob: dobDate.toDateString(),
status: true,
profilePhoto: '',
phoneVerified: false,
......@@ -268,6 +272,7 @@ export class AuthService {
.set(postData)
.then(() => {
console.log('successs');
this.service.set('userData', JSON.stringify(postData));
});
this.loader = false;
})
......
......@@ -7,6 +7,7 @@ export interface User {
profilePhoto: string;
emailVerified: boolean;
status: boolean;
dob: string;
loginType: number;
otp: string;
currency: {
......@@ -27,7 +28,8 @@ export interface Signup {
// Model for Change Details page
export interface UpdateUserDetails {
name: string;
// name: string;
phoneVerified: boolean;
phone: string;
}
// Model to Update Password
......
......@@ -57,12 +57,13 @@ export class UpdateService {
const postData: UpdateUserDetails = {
phone: userData.phone,
name: userData.name
phoneVerified: false
// name: userData.name
};
const updateOldData = {
...oldData,
phone: userData.phone,
name: userData.name
phone: userData.phone
// name: userData.name
};
this.userPostData = postData;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment