Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
getme
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
amal
getme
Commits
6ce03859
Commit
6ce03859
authored
Mar 05, 2020
by
Adarsh K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shopper service
parent
3d4110d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
shopper.service.ts
src/config/shopper.service.ts
+7
-6
No files found.
src/config/shopper.service.ts
View file @
6ce03859
...
...
@@ -70,19 +70,18 @@ export class ShoppersService {
const
This
=
this
;
const
state
=
true
;
this
.
shoppers
=
[];
const
itemsFound
=
{};
console
.
log
(
this
.
shoppers
);
const
catRef
=
this
.
afs
.
collection
(
'shopcategories'
).
doc
(
catId
).
get
().
subscribe
((
data
)
=>
{
this
.
shoppers
=
[];
console
.
log
(
data
.
data
());
const
shoppeerList
=
[];
const
shoppers
=
data
.
data
();
if
(
shoppers
&&
Object
.
keys
(
shoppers
).
length
>
0
)
{
Object
.
keys
(
shoppers
)
.
forEach
(
function
eachKey
(
key
)
{
shoppeerList
.
push
(
key
);
});
console
.
log
(
shoppeerList
);
if
(
shoppeerList
.
length
>
0
)
{
...
...
@@ -96,7 +95,6 @@ export class ShoppersService {
}
else
{
break
;
}
}
console
.
log
(
shopItems
);
const
orderRef
:
AngularFirestoreCollection
<
any
>
=
this
.
afs
.
collection
(
...
...
@@ -108,6 +106,7 @@ export class ShoppersService {
orderRef
.
valueChanges
().
subscribe
(
value
=>
{
console
.
log
(
value
);
const
res
=
value
;
if
(
res
.
length
>
0
)
{
res
.
forEach
(
item
=>
{
...
...
@@ -131,9 +130,12 @@ export class ShoppersService {
rate
:
item
.
rate
,
centerId
:
item
.
centerId
};
if
(
!
itemsFound
[
shopper
.
uid
])
{
this
.
shoppers
.
push
(
shopper
);
itemsFound
[
shopper
.
uid
]
=
true
;
}
});
// console.log(this.shoppers);
}
else
{
// alert('No Orders Found');
}
...
...
@@ -141,7 +143,6 @@ export class ShoppersService {
}
}
}
else
{
console
.
log
(
this
.
shoppers
);
this
.
shoppers
=
[];
this
.
shoppers
.
length
=
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment