1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/lib/wizard-subscription.js.es6

23 Zeilen
555 B
Text

2022-03-25 12:22:27 +01:00
const subscriptionTypes = ["standard", "business"];
function subscriptionTypeSufficient(subscriptionType, requiredType) {
2022-03-25 12:22:27 +01:00
if (requiredType && !subscriptionType) {
return false;
}
if (requiredType === "none" || requiredType === null) {
return true;
}
if (
requiredType === "standard" &&
subscriptionTypes.includes(subscriptionType)
) {
return true;
}
if (requiredType === "business" && subscriptionType === "business") {
return true;
}
return false;
}
2022-03-25 12:22:27 +01:00
export { subscriptionTypeSufficient, subscriptionTypes };