added missing job id
This commit is contained in:
parent
1358cd749a
commit
ea6686560d
@ -24,12 +24,10 @@ import { useParams } from "react-router-dom";
|
||||
|
||||
const ManageJob = ({ Job }) => {
|
||||
const { projectId } = useParams();
|
||||
|
||||
const methods = useAppForm({
|
||||
resolver: zodResolver(jobSchema),
|
||||
defaultValues: defaultJobValue,
|
||||
});
|
||||
|
||||
const {
|
||||
register,
|
||||
control,
|
||||
@ -39,12 +37,6 @@ const ManageJob = ({ Job }) => {
|
||||
formState: { errors },
|
||||
} = methods;
|
||||
|
||||
const {
|
||||
data,
|
||||
isLoading: isProjectLoading,
|
||||
isError: isProjectError,
|
||||
error,
|
||||
} = useServiceProjects(ITEMS_PER_PAGE, 1);
|
||||
const {
|
||||
data: JobTags,
|
||||
isLoading: isTagLoading,
|
||||
@ -56,8 +48,7 @@ const ManageJob = ({ Job }) => {
|
||||
isLoading: isJobLoading,
|
||||
isError: isJobError,
|
||||
error: jobError,
|
||||
} = useServiceProjectJobDetails(Job?.jobId);
|
||||
|
||||
} = useServiceProjectJobDetails(Job);
|
||||
const { mutate: CreateJob, isPending } = useCreateServiceProjectJob(() => {
|
||||
reset();
|
||||
});
|
||||
@ -90,7 +81,7 @@ const ManageJob = ({ Job }) => {
|
||||
reset({
|
||||
title: JobData.title ?? "",
|
||||
description: JobData.description ?? "",
|
||||
projectId: JobData.project?.id ?? projectId,
|
||||
projectId: JobData.project?.id ?? projectId,
|
||||
assignees: assignedEmployees,
|
||||
startDate: JobData.startDate ?? null,
|
||||
dueDate: JobData.dueDate ?? null,
|
||||
|
||||
@ -258,14 +258,10 @@ export const useUpdateServiceProjectJob = (onSuccessCallback) => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: async ({ id, payload }) => {
|
||||
|
||||
// Call the repository patch
|
||||
const resp = await ServiceProjectRepository.UpdateJob(
|
||||
id,
|
||||
payload
|
||||
);
|
||||
const resp = await ServiceProjectRepository.UpdateJob(id, payload);
|
||||
|
||||
return resp;
|
||||
return resp;
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["serviceProjectJobs"] });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user