mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-09 20:26:40 +00:00
🚨 fix lint error
This commit is contained in:
@@ -37,8 +37,9 @@ export async function generateNewEnterpriseLicense(
|
|||||||
next: NextFunction
|
next: NextFunction
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
try {
|
try {
|
||||||
|
const parsedParams = generateNewEnterpriseLicenseParamsSchema.safeParse(
|
||||||
const parsedParams = generateNewEnterpriseLicenseParamsSchema.safeParse(req.params);
|
req.params
|
||||||
|
);
|
||||||
if (!parsedParams.success) {
|
if (!parsedParams.success) {
|
||||||
return next(
|
return next(
|
||||||
createHttpError(
|
createHttpError(
|
||||||
@@ -63,7 +64,10 @@ export async function generateNewEnterpriseLicense(
|
|||||||
|
|
||||||
const licenseData = req.body;
|
const licenseData = req.body;
|
||||||
|
|
||||||
if (licenseData.tier != "big_license" && licenseData.tier != "small_license") {
|
if (
|
||||||
|
licenseData.tier != "big_license" &&
|
||||||
|
licenseData.tier != "small_license"
|
||||||
|
) {
|
||||||
return next(
|
return next(
|
||||||
createHttpError(
|
createHttpError(
|
||||||
HttpCode.BAD_REQUEST,
|
HttpCode.BAD_REQUEST,
|
||||||
@@ -79,7 +83,8 @@ export async function generateNewEnterpriseLicense(
|
|||||||
return next(
|
return next(
|
||||||
createHttpError(
|
createHttpError(
|
||||||
apiResponse.status || HttpCode.BAD_REQUEST,
|
apiResponse.status || HttpCode.BAD_REQUEST,
|
||||||
apiResponse.message || "Failed to create license from Fossorial API"
|
apiResponse.message ||
|
||||||
|
"Failed to create license from Fossorial API"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -112,8 +117,11 @@ export async function generateNewEnterpriseLicense(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const tier = licenseData.tier === "big_license" ? LicenseId.BIG_LICENSE : LicenseId.SMALL_LICENSE;
|
const tier =
|
||||||
const tierPrice = getLicensePriceSet()[tier]
|
licenseData.tier === "big_license"
|
||||||
|
? LicenseId.BIG_LICENSE
|
||||||
|
: LicenseId.SMALL_LICENSE;
|
||||||
|
const tierPrice = getLicensePriceSet()[tier];
|
||||||
|
|
||||||
const session = await stripe!.checkout.sessions.create({
|
const session = await stripe!.checkout.sessions.create({
|
||||||
client_reference_id: keyId.toString(),
|
client_reference_id: keyId.toString(),
|
||||||
@@ -122,7 +130,7 @@ export async function generateNewEnterpriseLicense(
|
|||||||
{
|
{
|
||||||
price: tierPrice, // Use the standard tier
|
price: tierPrice, // Use the standard tier
|
||||||
quantity: 1
|
quantity: 1
|
||||||
},
|
}
|
||||||
], // Start with the standard feature set that matches the free limits
|
], // Start with the standard feature set that matches the free limits
|
||||||
customer: customer.customerId,
|
customer: customer.customerId,
|
||||||
mode: "subscription",
|
mode: "subscription",
|
||||||
|
|||||||
Reference in New Issue
Block a user