New hires
Create a new hire
const newHire = await ft.newHires.create(data);
// use newHire.json() to access data
- Returns a
Response
object that resolves to aFreshteam.models.NewHire
object - The first argument is of type
Freshteam.models.NewHireCreate
Get new hire by ID
const newHireDetails = await ft.newHires.get(id, options);
// use newHireDetails.json() to access data
Returns a
Response
object that resolves to aFreshteam.models.EmployeeDetail
objectThe first argument is ID of the new hire
The second argument is an
Array
ofstring
containing names of related records to include- The property
options.include
can be added as anArray
ofstring
to include additional resources in the response, e.g.:
await ft.newHires.get(id, { include: ["branch", "team"], ...otherOptions }); // use newHires.json() to access data
- The property
Update an new hire
const updatedNewHire = await ft.newHires.update(id, data);
// use updatedNewHire.json() to access data
- Returns a
Response
object that resolves to aFreshteam.models.NewHire
object - The first argument is the new hire ID
- The second argument is an object of type
Freshteam.models.NewHireCreate