fix: update / create feature with empty ID / name
This commit is contained in:
@@ -12,6 +12,7 @@ export const ADMIN_USER_IDs = [
|
||||
"user_2tMgAiPsQzX8JTHjZZh9m0VdvUv", // a
|
||||
"user_2sB3tBXsnVVLlTKliQIqvvM2xfB", // j
|
||||
"ZsDswIXyOGMP9y1V1At4dAZNaiggClSs", // t
|
||||
"NqNuL3MtS7MR2WYoqx2b28iY9vmfAs8h", // c
|
||||
];
|
||||
// process.env.ENV === "production" || process.env.NODE_ENV === "production"
|
||||
// ? [
|
||||
|
||||
@@ -71,5 +71,12 @@ describe(`${chalk.yellowBright("temp: Testing add ons")}`, () => {
|
||||
customer_id: customerId,
|
||||
product_id: oneOff.id,
|
||||
});
|
||||
await autumn.attach({
|
||||
customer_id: customerId,
|
||||
product_id: oneOff.id,
|
||||
});
|
||||
|
||||
const customer = await autumn.customers.get(customerId);
|
||||
console.log("Customer:", customer);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,8 +19,12 @@ const featureDescriptions = {
|
||||
// Create Feature Params
|
||||
export const CreateFeatureV1ParamsSchema = z
|
||||
.object({
|
||||
id: z.string().meta({ description: featureDescriptions.id }),
|
||||
name: z.string().nullish().meta({ description: featureDescriptions.name }),
|
||||
id: z.string().nonempty().meta({ description: featureDescriptions.id }),
|
||||
name: z
|
||||
.string()
|
||||
.nonempty()
|
||||
.nullish()
|
||||
.meta({ description: featureDescriptions.name }),
|
||||
type: z.enum(FeatureType).meta({ description: featureDescriptions.type }),
|
||||
consumable: z.boolean().optional(),
|
||||
|
||||
|
||||
@@ -53,8 +53,8 @@ function UpdateFeatureSheet({
|
||||
try {
|
||||
await FeatureService.updateFeature(axiosInstance, selectedFeature.id, {
|
||||
...feature,
|
||||
id: feature.id,
|
||||
name: feature.name,
|
||||
id: feature.id || undefined,
|
||||
name: feature.name || undefined,
|
||||
type: feature.type,
|
||||
consumable: feature.config?.usage_type === FeatureUsageType.Single,
|
||||
event_names: feature.event_names,
|
||||
|
||||
Reference in New Issue
Block a user