added missing fuctionallity

This commit is contained in:
jfrye122
2023-05-14 21:02:09 -04:00
parent be9d285ac9
commit d19bc10865
18 changed files with 397 additions and 87 deletions

View File

@@ -29,39 +29,39 @@ export function* insertNewTimeTicket({ payload: { timeTicketInput } }) {
// pin: pin,
// });
// const { valid, data, error } = response.data;
const result = yield client.mutate({
mutation: INSERT_NEW_TIME_TICKET,
variables: {
timeTicketInput: [
// {
// bodyshopid: bodyshop.id,
// employeeid: technician.id,
// date: moment(theTime).format("YYYY-MM-DD"),
// clockon: moment(theTime),
// jobid: values.jobid,
// cost_center: values.cost_center,
// ciecacode:
// bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
// ? values.cost_center
// : Object.keys(
// bodyshop.md_responsibility_centers.defaults.costs
// ).find((key) => {
// return (
// bodyshop.md_responsibility_centers.defaults.costs[key] ===
// values.cost_center
// );
// }),
// },
],
},
});
console.log(result);
const { valid, data, error } = result.data;
if (valid) {
yield put(timeTicketCreateSuccess(data));
} else {
yield put(timeTicketCreateFailure(error));
}
// const result = yield client.mutate({
// mutation: INSERT_NEW_TIME_TICKET,
// variables: {
// timeTicketInput: [
// // {
// // bodyshopid: bodyshop.id,
// // employeeid: technician.id,
// // date: moment(theTime).format("YYYY-MM-DD"),
// // clockon: moment(theTime),
// // jobid: values.jobid,
// // cost_center: values.cost_center,
// // ciecacode:
// // bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
// // ? values.cost_center
// // : Object.keys(
// // bodyshop.md_responsibility_centers.defaults.costs
// // ).find((key) => {
// // return (
// // bodyshop.md_responsibility_centers.defaults.costs[key] ===
// // values.cost_center
// // );
// // }),
// // },
// ],
// },
// });
// console.log(result);
// const { valid, data, error } = result.data;
// if (valid) {
// yield put(timeTicketCreateSuccess(data));
// } else {
// yield put(timeTicketCreateFailure(error));
// }
} catch (error) {
yield put(timeTicketCreateFailure(error));
}