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 ManageJob = ({ Job }) => {
|
||||||
const { projectId } = useParams();
|
const { projectId } = useParams();
|
||||||
|
|
||||||
const methods = useAppForm({
|
const methods = useAppForm({
|
||||||
resolver: zodResolver(jobSchema),
|
resolver: zodResolver(jobSchema),
|
||||||
defaultValues: defaultJobValue,
|
defaultValues: defaultJobValue,
|
||||||
});
|
});
|
||||||
|
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
control,
|
control,
|
||||||
@ -39,12 +37,6 @@ const ManageJob = ({ Job }) => {
|
|||||||
formState: { errors },
|
formState: { errors },
|
||||||
} = methods;
|
} = methods;
|
||||||
|
|
||||||
const {
|
|
||||||
data,
|
|
||||||
isLoading: isProjectLoading,
|
|
||||||
isError: isProjectError,
|
|
||||||
error,
|
|
||||||
} = useServiceProjects(ITEMS_PER_PAGE, 1);
|
|
||||||
const {
|
const {
|
||||||
data: JobTags,
|
data: JobTags,
|
||||||
isLoading: isTagLoading,
|
isLoading: isTagLoading,
|
||||||
@ -56,8 +48,7 @@ const ManageJob = ({ Job }) => {
|
|||||||
isLoading: isJobLoading,
|
isLoading: isJobLoading,
|
||||||
isError: isJobError,
|
isError: isJobError,
|
||||||
error: jobError,
|
error: jobError,
|
||||||
} = useServiceProjectJobDetails(Job?.jobId);
|
} = useServiceProjectJobDetails(Job);
|
||||||
|
|
||||||
const { mutate: CreateJob, isPending } = useCreateServiceProjectJob(() => {
|
const { mutate: CreateJob, isPending } = useCreateServiceProjectJob(() => {
|
||||||
reset();
|
reset();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -258,12 +258,8 @@ export const useUpdateServiceProjectJob = (onSuccessCallback) => {
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: async ({ id, payload }) => {
|
mutationFn: async ({ id, payload }) => {
|
||||||
|
|
||||||
// Call the repository patch
|
// Call the repository patch
|
||||||
const resp = await ServiceProjectRepository.UpdateJob(
|
const resp = await ServiceProjectRepository.UpdateJob(id, payload);
|
||||||
id,
|
|
||||||
payload
|
|
||||||
);
|
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user