mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-16 06:26:09 +00:00
Fixed Serverless examples: they were not returning 400 if model name was not provided
This commit is contained in:
@@ -7,17 +7,15 @@ import { PKPass } from "passkit-generator";
|
||||
|
||||
const S3: { instance: AWS.S3 } = { instance: undefined };
|
||||
|
||||
export function finish400WithoutModelName(event: ALBEvent) {
|
||||
if (event.queryStringParameters?.modelName) {
|
||||
return;
|
||||
export function throwClientErrorWithoutModelName(event: ALBEvent) {
|
||||
if (!event.queryStringParameters?.modelName) {
|
||||
throw {
|
||||
statusCode: 400,
|
||||
body: JSON.stringify({
|
||||
message: "modelName is missing in query params",
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
statusCode: 400,
|
||||
body: JSON.stringify({
|
||||
message: "modelName is missing in query params",
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
export function getRandomColorPart() {
|
||||
|
||||
Reference in New Issue
Block a user