2026-08-15 05:55:55 +00:00
|
|
|
// Module ID: 14560
|
|
|
|
|
// Function ID: 14561
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: getRoleSubscriptionPlanId
|
2026-07-29 08:29:29 +00:00
|
|
|
// Dependencies: [38, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: getRoleSubscriptionMutationPlanId, getRoleSubscriptionPlanId
|
|
|
|
|
|
2026-08-15 05:55:55 +00:00
|
|
|
// Module 14560 (getRoleSubscriptionPlanId)
|
2026-07-23 10:11:24 +00:00
|
|
|
const result = require("set").fileFinishedImporting("modules/guild_role_subscriptions/subscriptionUtils.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const getRoleSubscriptionPlanId = function getRoleSubscriptionPlanId(items) {
|
|
|
|
|
items = items.items;
|
2026-07-29 08:29:29 +00:00
|
|
|
importDefault(38)(1 === items.length, "more than 1 subscription item for role subscription");
|
2026-07-20 16:05:17 +00:00
|
|
|
return items[0].planId;
|
|
|
|
|
};
|
|
|
|
|
export const getRoleSubscriptionMutationPlanId = function getRoleSubscriptionMutationPlanId(renewalMutations) {
|
|
|
|
|
let items;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (renewalMutations != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
renewalMutations = renewalMutations.renewalMutations;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (renewalMutations != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
items = renewalMutations.items;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (null != items) {
|
2026-07-29 08:29:29 +00:00
|
|
|
importDefault(38)(items.length <= 1, "more than 1 renewal mutation for role subscription");
|
2026-07-20 16:05:17 +00:00
|
|
|
let planId;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (items != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
planId = items[0].planId;
|
|
|
|
|
}
|
|
|
|
|
return planId;
|
|
|
|
|
}
|
|
|
|
|
};
|