Merged in feature/IO-3499-React-19 (pull request #2838)
Feature/IO-3499 React 19
This commit is contained in:
@@ -21,15 +21,21 @@ export default function ShopEmployeeAddVacation({ employee }) {
|
||||
logImEXEvent("employee_add_vacation");
|
||||
|
||||
setLoading(true);
|
||||
let result;
|
||||
if (!employee?.id) {
|
||||
notification.error({
|
||||
title: t("employees.errors.adding", { message: "Employee not loaded yet." })
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
result = await insertVacation({
|
||||
setLoading(true);
|
||||
const result = await insertVacation({
|
||||
variables: { vacation: { ...values, employeeid: employee.id } },
|
||||
update(cache, { data }) {
|
||||
cache.modify({
|
||||
id: cache.identify({ id: employee.id, __typename: "employees" }),
|
||||
fields: {
|
||||
employee_vacations(ex) {
|
||||
employee_vacations(ex = []) {
|
||||
return [data.insert_employee_vacation_one, ...ex];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user