mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 19:25:23 +00:00
Fixed checks on currentPassType
This commit is contained in:
@@ -40,9 +40,7 @@ exports.pass = functions.https.onRequest(async (request, response) => {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
let currentPassType = request.body.passType;
|
if (newPass.type == "boardingPass") {
|
||||||
|
|
||||||
if (currentPassType == "boardingPass") {
|
|
||||||
newPass.transitType = `PKTransitType${request.body.transitType}`;
|
newPass.transitType = `PKTransitType${request.body.transitType}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +87,7 @@ exports.pass = functions.https.onRequest(async (request, response) => {
|
|||||||
key: `primary${i}`,
|
key: `primary${i}`,
|
||||||
label: field.label,
|
label: field.label,
|
||||||
value:
|
value:
|
||||||
currentPassType == "boardingPass"
|
newPass.type == "boardingPass"
|
||||||
? field.value.toUpperCase()
|
? field.value.toUpperCase()
|
||||||
: field.value,
|
: field.value,
|
||||||
});
|
});
|
||||||
@@ -153,7 +151,7 @@ exports.pass = functions.https.onRequest(async (request, response) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Downloading thumbnail and logo files from Firebase Storage and adding to pass
|
// Downloading thumbnail and logo files from Firebase Storage and adding to pass
|
||||||
if (currentPassType == "generic" || currentPassType == "eventTicket") {
|
if (newPass.type == "generic" || newPass.type == "eventTicket") {
|
||||||
const thumbnailFile = request.body.thumbnailFile;
|
const thumbnailFile = request.body.thumbnailFile;
|
||||||
const tempPath1 = path.join(os.tmpdir(), thumbnailFile);
|
const tempPath1 = path.join(os.tmpdir(), thumbnailFile);
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user