You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
39 lines
1.1 KiB
export const getEmployeeFromPrice = (priceUUID, selfUser) => { |
|
const employees = selfUser && selfUser.client && selfUser.client.employees; |
|
let matchEmployee = null; |
|
employees.forEach(employee => { |
|
const priceMatch = employee.prices.filter(price => { |
|
return price.uuid === priceUUID; |
|
}); |
|
if (priceMatch.length > 0) { |
|
matchEmployee = employee; |
|
} |
|
}); |
|
return matchEmployee; |
|
}; |
|
|
|
export const getWorkTypeFromPrice = (priceUUID, selfUser) => { |
|
const employees = selfUser && selfUser.client && selfUser.client.employees; |
|
let matchWorkType = null; |
|
employees.forEach(employee => { |
|
employee.prices.forEach(price => { |
|
if (price.uuid === priceUUID) { |
|
matchWorkType = price.work_type; |
|
} |
|
}); |
|
}); |
|
return matchWorkType; |
|
}; |
|
|
|
export const getPriceFromPrice = (priceUUID, selfUser) => { |
|
const employees = selfUser && selfUser.client && selfUser.client.employees; |
|
let matchPrice = null; |
|
employees.forEach(employee => { |
|
employee.prices.forEach(price => { |
|
if (price.uuid === priceUUID) { |
|
matchPrice = price; |
|
} |
|
}); |
|
}); |
|
return matchPrice; |
|
};
|
|
|