mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
fix: project time entry form.
This commit is contained in:
@@ -73,7 +73,7 @@ function ProjectTimeEntryForm({
|
||||
setSubmitting(false);
|
||||
};
|
||||
if (isNewMode) {
|
||||
createProjectTimeEntryMutate([values.taskId, form])
|
||||
createProjectTimeEntryMutate([values.task_id, form])
|
||||
.then(onSuccess)
|
||||
.catch(onError);
|
||||
} else {
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import React from 'react';
|
||||
import { isNull } from 'lodash';
|
||||
import { useFormikContext } from 'formik';
|
||||
import { useProjectTimeEntryFormContext } from './ProjectTimeEntryFormProvider';
|
||||
|
||||
export const useSetProjectToForm = () => {
|
||||
const { values } = useFormikContext();
|
||||
const { setProjectPayload } = useProjectTimeEntryFormContext();
|
||||
const { setProjectPayload, projectId } = useProjectTimeEntryFormContext();
|
||||
|
||||
React.useEffect(() => {
|
||||
if (values.project_id) {
|
||||
if (isNull(projectId)) {
|
||||
setProjectPayload(values.project_id);
|
||||
}
|
||||
}, [values.projectId]);
|
||||
}, [values.project_id]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user