Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
hdastageeri
hft_awado_app
Commits
e758ba22
Commit
e758ba22
authored
Nov 29, 2019
by
Priyanka Upadhye
Browse files
end trip api called
parent
c181bd02
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/hirebike/hirebike.page.html
View file @
e758ba22
...
...
@@ -46,14 +46,10 @@
<div
class=
"inner"
>
<div
class=
"button-container"
>
<ion-grid>
<ion-row>
<ion-col>
Any Problems?
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-button
size=
"medium"
expand=
"block"
(click)=
"CancelTrip()"
>
Cancel
Trip
</ion-button>
<ion-button
size=
"medium"
expand=
"block"
(click)=
"CancelTrip()"
>
End
Trip
</ion-button>
</ion-col>
</ion-row>
</ion-grid>
...
...
src/app/hirebike/hirebike.page.ts
View file @
e758ba22
...
...
@@ -110,7 +110,23 @@ export class HirebikePage implements OnInit {
}
CancelTrip
(){
this
.
storage
.
get
(
'
token
'
).
then
((
token
)
=>
{
let
url
=
'
http://193.196.52.237:8081/rent
'
+
'
?bikeId=
'
+
this
.
bikeDetails
.
id
;
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
let
bikeApi
=
this
.
httpClient
.
delete
(
url
,
{
headers
});
bikeApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
'
my data:
'
,
resp
);
this
.
toastService
.
showToast
(
"
Trip Ended!
"
);
},
(
error
)
=>
{
console
.
log
(
error
)
this
.
toastService
.
showToast
(
"
Unavle to end trip
"
)
});
});
}
loadmap
()
{
var
defaultLayers
=
this
.
platform
.
createDefaultLayers
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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