mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Coupon->Update returnData format fix, coupon description fix
This commit is contained in:
parent
ddf995fca1
commit
cfe3f22204
|
@ -131,7 +131,7 @@ export const couponFields = [
|
||||||
displayName: 'Discount Amount Currency',
|
displayName: 'Discount Amount Currency',
|
||||||
name: 'discountAmount',
|
name: 'discountAmount',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
default: '',
|
default: 1,
|
||||||
description: 'Discount amount in currency.',
|
description: 'Discount amount in currency.',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
minValue: 1
|
minValue: 1
|
||||||
|
@ -157,7 +157,7 @@ export const couponFields = [
|
||||||
displayName: 'Discount Amount %',
|
displayName: 'Discount Amount %',
|
||||||
name: 'discountAmount',
|
name: 'discountAmount',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
default: '',
|
default: 1,
|
||||||
description: 'Discount amount in percentage.',
|
description: 'Discount amount in percentage.',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
minValue: 1,
|
minValue: 1,
|
||||||
|
|
|
@ -210,7 +210,7 @@ export class Paddle implements INodeType {
|
||||||
const discountAmount = this.getNodeParameter('discountAmount', i) as number;
|
const discountAmount = this.getNodeParameter('discountAmount', i) as number;
|
||||||
|
|
||||||
if (couponType === 'product') {
|
if (couponType === 'product') {
|
||||||
body.product_ids = (this.getNodeParameter('productIds', i) as string[]).join();
|
body.product_ids = this.getNodeParameter('productIds', i) as string;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (discountType === 'flat') {
|
if (discountType === 'flat') {
|
||||||
|
@ -253,7 +253,7 @@ export class Paddle implements INodeType {
|
||||||
const endpoint = '/2.1/product/create_coupon';
|
const endpoint = '/2.1/product/create_coupon';
|
||||||
|
|
||||||
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
||||||
responseData = responseData.response.coupon_codes;
|
responseData = responseData.response.coupon_codes.map((coupon : string) => ({coupon}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue