mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 11:25:17 +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(
|
||||
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(
|
||||
{
|
||||
// Get relevant pass model from model folder (see passkit-generator/examples/models/)
|
||||
|
||||
Reference in New Issue
Block a user