Skip to content

Commit e74215a

Browse files
Fix: Replace compound name prop with separate firstName and lastName props
1 parent 119e9e5 commit e74215a

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

components/hr_cloud/actions/create-employee/create-employee.mjs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ export default {
88
type: "action",
99
props: {
1010
hrCloud,
11-
name: {
11+
firstName: {
1212
propDefinition: [
1313
hrCloud,
14-
"name",
14+
"firstName",
15+
],
16+
},
17+
lastName: {
18+
propDefinition: [
19+
hrCloud,
20+
"lastName",
1521
],
1622
},
1723
email: {
@@ -43,16 +49,16 @@ export default {
4349
const response = await this.hrCloud.createEmployee({
4450
$,
4551
data: {
46-
first_name: this.name.firstName,
47-
last_name: this.name.lastName,
52+
first_name: this.firstName,
53+
last_name: this.lastName,
4854
email: this.email,
4955
job_title_id: this.jobTitle,
5056
department_id: this.departmentId,
5157
start_date: this.startDate,
5258
},
5359
});
5460

55-
$.export("$summary", `Successfully created employee: ${this.name.firstName} ${this.name.lastName}`);
61+
$.export("$summary", `Successfully created employee: ${this.firstName} ${this.lastName}`);
5662
return response;
5763
},
5864
};

components/hr_cloud/hr_cloud.app.mjs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,15 @@ export default {
117117
description: "Additional notes for the timesheet entry",
118118
optional: true,
119119
},
120-
name: {
121-
type: "object",
122-
label: "Name",
123-
description: "The employee's name",
124-
properties: {
125-
firstName: {
126-
type: "string",
127-
label: "First Name",
128-
description: "The employee's first name",
129-
},
130-
lastName: {
131-
type: "string",
132-
label: "Last Name",
133-
description: "The employee's last name",
134-
},
135-
},
120+
firstName: {
121+
type: "string",
122+
label: "First Name",
123+
description: "The employee's first name",
124+
},
125+
lastName: {
126+
type: "string",
127+
label: "Last Name",
128+
description: "The employee's last name",
136129
},
137130
email: {
138131
type: "string",

0 commit comments

Comments
 (0)