+
+ Invite a Family
+
@@ -16,17 +19,17 @@
diff --git a/src/app/components/add-relatives/add-relatives.component.scss b/src/app/components/add-relatives/add-relatives.component.scss
index e69de29..9478b26 100644
--- a/src/app/components/add-relatives/add-relatives.component.scss
+++ b/src/app/components/add-relatives/add-relatives.component.scss
@@ -0,0 +1,9 @@
+.input-item{
+ background-color: #fbf9f4;
+ border-radius: 10px;
+ padding-left: 5px;
+}
+.head-title{
+ font-weight: bolder;
+ padding: 5px 0px 10px 0px;
+}
\ No newline at end of file
diff --git a/src/app/components/add-relatives/add-relatives.component.ts b/src/app/components/add-relatives/add-relatives.component.ts
index bdb9291..9d5d862 100644
--- a/src/app/components/add-relatives/add-relatives.component.ts
+++ b/src/app/components/add-relatives/add-relatives.component.ts
@@ -2,6 +2,7 @@ import {Component, OnInit, ViewChild} from '@angular/core';
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
import {LoadingController} from "@ionic/angular";
+import {CommonfuncService} from "../../services/commonfunc.service";
@Component({
selector: 'app-add-relatives',
@@ -24,7 +25,8 @@ export class AddRelativesComponent implements OnInit {
constructor(
public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService,
- private loadingCtrl: LoadingController
+ private loadingCtrl: LoadingController,
+ private commonfuncService: CommonfuncService
) { }
regMonth:any;
@@ -53,7 +55,7 @@ export class AddRelativesComponent implements OnInit {
isDisabled:boolean= true;
verifyEntry(){
this.isDisabled= true;
- if ( this.firstname.length> 1 && this.lastname.length> 1 && this.month> 0 && this.year> 0 ){
+ if ( this.firstname.length> 1 && this.lastname.length> 1 && this.commonfuncService.validateEmail(this.email)== true ){
this.isDisabled= false;
}
}
@@ -74,8 +76,7 @@ export class AddRelativesComponent implements OnInit {
sessionid: string,
firstname:string,
lastname: string,
- month: number,
- year: number
+ email: number,
};
createFamilyResult:any;
@@ -83,22 +84,20 @@ export class AddRelativesComponent implements OnInit {
async inviteFamily(){
const loading = await this.loadingCtrl.create({
message: 'Sending Invite...',
- duration: 5000,
+ duration: 6500,
});
this.reqData={
- action:22015,
+ action:22031,
member_id: this.sessionDataProviderService.member_id,
uid: this.sessionDataProviderService.member_uid,
sessionid: this.sessionDataProviderService.session ,
firstname: this.firstname,
lastname: this.lastname,
- month: this.month,
- year: this.year
+ email: this.email,
}
loading.present();
-return;
- this.wrenchService.familyAdd(this.reqData).subscribe(
+ this.wrenchService.familyInvite(this.reqData).subscribe(
createFamilyResult => {
loading.dismiss();
this.createFamilyResult = createFamilyResult;
@@ -106,8 +105,8 @@ return;
if (this.createFamilyResult.internal_return> 0){
this.firstname='';
this.lastname='';
-
- this.createFamilyResult = "Family Added";
+ this.email='';
+ this.createFamilyResult = "Invite Sent.";
setTimeout(()=>{
this.createFamilyResult="";
this.setCloseModal();
@@ -118,5 +117,4 @@ return;
}
-
}
diff --git a/src/app/components/interest-card/interest-card.component.html b/src/app/components/interest-card/interest-card.component.html
index 6c1323d..fcca5f9 100644
--- a/src/app/components/interest-card/interest-card.component.html
+++ b/src/app/components/interest-card/interest-card.component.html
@@ -10,6 +10,10 @@
Member Since : {{intData.client_added | date}}
+
+
+ Interest Date : {{intData.sent | date}}
+
diff --git a/src/app/services/commonfunc.service.spec.ts b/src/app/services/commonfunc.service.spec.ts
new file mode 100644
index 0000000..5c94b1a
--- /dev/null
+++ b/src/app/services/commonfunc.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { CommonfuncService } from './commonfunc.service';
+
+describe('CommonfuncService', () => {
+ let service: CommonfuncService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(CommonfuncService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/services/commonfunc.service.ts b/src/app/services/commonfunc.service.ts
new file mode 100644
index 0000000..3fa1175
--- /dev/null
+++ b/src/app/services/commonfunc.service.ts
@@ -0,0 +1,15 @@
+import { Injectable } from '@angular/core';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class CommonfuncService {
+
+ constructor() { }
+
+ validateEmail(email) {
+ var re = /\S+@\S+\.\S+/;
+ return re.test(email);
+ }
+
+}
diff --git a/src/app/services/wrench.service.ts b/src/app/services/wrench.service.ts
index 48115cf..09226ec 100644
--- a/src/app/services/wrench.service.ts
+++ b/src/app/services/wrench.service.ts
@@ -85,6 +85,11 @@ export class WrenchService {
return this.getPostData('familyadd', reqData);
}
+ familyInvite(reqData) {
+ return this.getPostData('familyrelinvite', reqData);
+ }
+
+
referHx(reqData) {
return this.getPostData('refferhx', reqData);
}