Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
hdastageeri
hft_awado_app
Commits
df0f482f
Commit
df0f482f
authored
Nov 28, 2019
by
Priyanka Upadhye
Browse files
Added bike reservation api call.
parent
6fe5f51f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/app/home/home.page.ts
View file @
df0f482f
...
...
@@ -24,7 +24,7 @@ export class HomePage {
public
is3DChecked
=
false
;
public
isDetailsVisible
=
false
;
public
selectedBike
=
{};
public
selectedBike
=
{
id
:
0
};
public
tempArr
=
[
1
,
2
];
public
locationArr
=
[{
lat
:
48.778409
,
lng
:
9.179252
},
...
...
@@ -229,7 +229,23 @@ export class HomePage {
showBikeDetails
(
bike
)
{
this
.
selectedBike
=
bike
;
this
.
selectedBike
.
id
=
bike
.
id
;
this
.
isDetailsVisible
=
true
;
}
reserveBike
()
{
//this.selectedBike=bikeS;
this
.
storage
.
get
(
'
token
'
).
then
((
token
)
=>
{
let
url
=
'
http://193.196.52.237:8081/reservation
'
+
'
?bikeId=
'
+
this
.
selectedBike
.
id
;
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
this
.
bikeApi
=
this
.
httpClient
.
get
(
url
,
{
headers
});
this
.
bikeApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
'
my data:
'
,
resp
);
this
.
bikes
=
resp
;
},
(
error
)
=>
console
.
log
(
error
));
});
}
}
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