Skip to content

Commit 4f1ade2

Browse files
committed
Added actions
1 parent ad6e1ca commit 4f1ade2

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

components/etermin/actions/create-contact/create-contact.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,18 @@ export default {
6363
},
6464
},
6565
async run({ $ }) {
66+
const updateWhenExistsgdt = this.updateWhenExistsgdt === true || this.updateWhenExistsgdt === "true"
67+
? 1
68+
: 0;
69+
6670
const response = await this.app.createContact({
6771
$,
6872
params: {
69-
updatewhenexistsgdt: this.updateWhenExistsgdt,
73+
updatewhenexistsgdt: updateWhenExistsgdt,
7074
salutation: this.salutation,
7175
title: this.title,
72-
lastname: this.lastName,
73-
firstname: this.firstName,
76+
lastname: this.lastname,
77+
firstname: this.firstname,
7478
company: this.company,
7579
birthday: this.birthday,
7680
email: this.email,

components/etermin/actions/create-voucher/create-voucher.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ export default {
6262
params: {
6363
id: this.id,
6464
description: this.description,
65-
priceinclvat: this.priceInClvat,
66-
priceoriginal: this.priceOriginal,
67-
ispercentage: this.isPercentage,
65+
priceinclvat: this.priceInclVat,
66+
priceoriginal: this.priceInclVat, // Docs: Should be the same value as in priceinclvat, important with contingent
67+
ispercentage: this.isPercentage
68+
? 1
69+
: 0,
6870
customeremail: this.customerEmail,
6971
validfrom: this.validFrom,
7072
validuntil: this.validUntil,

components/etermin/common/constants.mjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

components/etermin/etermin.app.mjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { axios } from "@pipedream/platform";
2-
import constants from "./common/constants.mjs";
32

43
export default {
54
type: "app",
65
app: "etermin",
76
propDefinitions: {
87
updateWhenExistsgdt: {
9-
type: "string",
8+
type: "boolean",
109
label: "Update When Exists",
1110
description: "Set to 1 to check if the contact is already existing. If so the existing contact gets updated. Needs email or firstname, lastname and birthday",
12-
options: constants.UPDATE_OPTIONS,
1311
},
1412
salutation: {
1513
type: "string",
@@ -64,7 +62,7 @@ export default {
6462
isPercentage: {
6563
type: "boolean",
6664
label: "Is Percentage",
67-
description: "Indicates if the value of the vaucher is a percentage",
65+
description: "Indicates if the value of the voucher is a percentage",
6866
},
6967
customerEmail: {
7068
type: "string",
@@ -88,7 +86,7 @@ export default {
8886
},
8987
async _makeRequest(opts = {}) {
9088
const {
91-
$ = this,
89+
$,
9290
path,
9391
headers,
9492
...otherOpts

0 commit comments

Comments
 (0)