Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fcb35f1e40 | |||
| 048c2edb9b | |||
| de8aa503ba |
@@ -5,7 +5,6 @@ import { NavController } from 'ionic-angular';
|
|||||||
import { ChatPage } from '../chat/chat';
|
import { ChatPage } from '../chat/chat';
|
||||||
import { ProfileService } from '../../services/profiles';
|
import { ProfileService } from '../../services/profiles';
|
||||||
import { ProfilePage } from '../profile/profile';
|
import { ProfilePage } from '../profile/profile';
|
||||||
import { TellYourStoryPage } from '../tell/tell';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-grid',
|
selector: 'page-grid',
|
||||||
@@ -20,6 +19,7 @@ export class GridPage {
|
|||||||
constructor(public navCtrl: NavController, public profileService: ProfileService, private _sanitizer: DomSanitizer) {
|
constructor(public navCtrl: NavController, public profileService: ProfileService, private _sanitizer: DomSanitizer) {
|
||||||
profileService.loadVerified().then((data) => {
|
profileService.loadVerified().then((data) => {
|
||||||
this.profiles = data;
|
this.profiles = data;
|
||||||
|
console.debug('profiles: ', this.profiles);
|
||||||
});
|
});
|
||||||
this.tabNavEl = document.querySelector('#tab-nav .tabbar');
|
this.tabNavEl = document.querySelector('#tab-nav .tabbar');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export class ProfileService {
|
|||||||
.map(res => res.json())
|
.map(res => res.json())
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.profiles = {};
|
this.profiles = this.profiles || {};
|
||||||
this.profiles[type] = data;
|
this.profiles[type] = data;
|
||||||
this.profiles[type].reduce((map, profile, i) => {
|
this.profiles[type].reduce((map, profile, i) => {
|
||||||
map[profile._id] = i;
|
map[profile._id] = i;
|
||||||
@@ -62,7 +62,7 @@ export class ProfileService {
|
|||||||
resolve(this.profiles[type]);
|
resolve(this.profiles[type]);
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
this.doGetRequest(this.fallback, resolve);
|
this.doGetRequest(this.fallback, resolve, type);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -80,7 +80,7 @@ export class ProfileService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getProfiles() {
|
getProfiles() {
|
||||||
return this.profiles;
|
return this.profiles.all;
|
||||||
}
|
}
|
||||||
|
|
||||||
getProfileById(id) {
|
getProfileById(id) {
|
||||||
@@ -88,10 +88,10 @@ export class ProfileService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getSubmittedProfiles() {
|
getSubmittedProfiles() {
|
||||||
|
return this.profiles.submitted;
|
||||||
}
|
}
|
||||||
|
|
||||||
getVerifiedProfiles() {
|
getVerifiedProfiles() {
|
||||||
|
return this.profiles.verified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user