Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
b8d4ebea
Commit
b8d4ebea
authored
Oct 10, 2021
by
Kai Uwe Broulik
🍇
Browse files
Extract Cancel URL from Lufthansa pkpass
parent
db335199
Pipeline
#87845
passed with stage
in 14 minutes and 2 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/lib/scripts/lufthansa-pkpass.js
View file @
b8d4ebea
...
...
@@ -21,5 +21,15 @@ function main(pass, node)
res
.
underName
.
name
=
passengerName
.
value
;
}
const
back
=
pass
.
backFields
;
const
cancelLink
=
back
.
find
(
item
=>
item
.
key
===
"
cancel
"
);
if
(
cancelLink
)
{
const
cancelUrl
=
cancelLink
.
value
.
match
(
/https:
\/\/
mobile.lufthansa.com
\/
service
\/
checkin
\?[
A-Z0-9=&
]
*
[
A-Z0-9=&
]
/i
);
if
(
cancelUrl
)
{
res
.
potentialAction
=
JsonLd
.
newObject
(
"
CancelAction
"
);
res
.
potentialAction
.
url
=
cancelUrl
[
1
];
}
}
return
res
;
}
Write
Preview
Supports
Markdown
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