Added check on boardingPass in examples to not make crash the request if we are creating a boarding pass

This commit is contained in:
Alexander Cerutti
2021-12-30 13:31:22 +01:00
parent 92ab060c7d
commit 8c39928f0c
6 changed files with 27 additions and 2 deletions

View File

@@ -51,6 +51,11 @@ app.route("/localize/:modelName").get(async (request, response) => {
console.log("Added languages", Object.keys(pass.languages).join(", "));
if (pass.type === "boardingPass" && !pass.transitType) {
// Just to not make crash the creation if we use a boardingPass
pass.transitType = "PKTransitTypeAir";
}
const stream = pass.getAsStream();
response.set({