import * as tslib_1 from "tslib";
import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import { AngularFirestore } from '@angular/fire/firestore';
let UserService = 
// Gets User Details
class UserService {
    constructor(afs, afAuth) {
        this.afs = afs;
        this.afAuth = afAuth;
    }
    getUserData(userId) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const This = this;
            const state = true;
            // Get User Query
            const userRef = this.afs.collection('customers', ref => ref.where('uid', '==', userId).where('status', '==', state));
            userRef.valueChanges().subscribe(value => {
                const res = value;
                if (res.length > 0) {
                    const item = res[0];
                    this.users = {
                        name: item.name,
                        emailId: item.emailId,
                        phone: item.phone,
                        uid: item.uid,
                        profilePhoto: item.profilePic,
                        status: item.status,
                        phoneVerified: item.phoneVerified,
                        emailVerified: item.emailVerified,
                        dob: item.dob,
                        loginType: 0,
                        otp: '',
                        currency: {
                            currId: '',
                            currName: '',
                            symbol: ''
                        }
                    };
                }
                //   return this.users;
            });
        });
    }
};
UserService = tslib_1.__decorate([
    Injectable({
        providedIn: 'root'
    })
    // Gets User Details
    ,
    tslib_1.__metadata("design:paramtypes", [AngularFirestore, AngularFireAuth])
], UserService);
export { UserService };
//# sourceMappingURL=user.service.js.map