mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 13:25:19 +00:00
Added early termination if passModel is not specified
This commit is contained in:
@@ -58,6 +58,15 @@ declare global {
|
|||||||
|
|
||||||
export const pass = functions.https.onRequest(
|
export const pass = functions.https.onRequest(
|
||||||
async (request: RequestWithBody, response) => {
|
async (request: RequestWithBody, response) => {
|
||||||
|
if (!request.body.passModel) {
|
||||||
|
response.status(400);
|
||||||
|
response.send({
|
||||||
|
error: "Unspecified 'passModel' parameter: which model should be used?",
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const newPass = await PKPass.from(
|
const newPass = await PKPass.from(
|
||||||
{
|
{
|
||||||
// Get relevant pass model from model folder (see passkit-generator/examples/models/)
|
// Get relevant pass model from model folder (see passkit-generator/examples/models/)
|
||||||
|
|||||||
Reference in New Issue
Block a user