HUGE REFACTOR / CLEANUP
if there is a issue it's probably something in here that was changed
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* xxxeslint-disable */
|
||||
import ayatype from "./ayatype";
|
||||
export default {
|
||||
///////////////////////////////
|
||||
@@ -19,7 +18,7 @@ export default {
|
||||
}
|
||||
|
||||
if (tid.type && tid.id != null) {
|
||||
let isCustomerTypeUser =
|
||||
const isCustomerTypeUser =
|
||||
window.$gz.store.state.userType == 3 ||
|
||||
window.$gz.store.state.userType == 4;
|
||||
//if these come from route parameters they may well be strings
|
||||
@@ -68,7 +67,7 @@ export default {
|
||||
case ayatype.WorkOrderItemUnit:
|
||||
(async () => {
|
||||
try {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
`search/ancestor/${tid.type}/${tid.id}`
|
||||
);
|
||||
|
||||
@@ -112,7 +111,7 @@ export default {
|
||||
case ayatype.QuoteItemUnit:
|
||||
(async () => {
|
||||
try {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
`search/ancestor/${tid.type}/${tid.id}`
|
||||
);
|
||||
|
||||
@@ -157,7 +156,7 @@ export default {
|
||||
case ayatype.PMItemUnit:
|
||||
(async () => {
|
||||
try {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
`search/ancestor/${tid.type}/${tid.id}`
|
||||
);
|
||||
|
||||
@@ -233,11 +232,10 @@ export default {
|
||||
tid.inside = true;
|
||||
}
|
||||
if (tid.inside == undefined) {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
"user/inside-type/" + tid.id
|
||||
);
|
||||
if (res.error) {
|
||||
//throw new Error(res.error);
|
||||
throw new Error(
|
||||
window.$gz.errorHandler.errorToString(res, vm)
|
||||
);
|
||||
@@ -276,7 +274,7 @@ export default {
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
"attachment/parent/" + tid.id
|
||||
);
|
||||
|
||||
@@ -326,12 +324,11 @@ export default {
|
||||
//all we have is the id, but need the formkey to open it
|
||||
(async () => {
|
||||
try {
|
||||
let res = await window.$gz.api.get(
|
||||
const res = await window.$gz.api.get(
|
||||
"form-custom/form-key/" + tid.id
|
||||
);
|
||||
|
||||
if (res.error) {
|
||||
//throw new Error(res.error);
|
||||
throw new Error(
|
||||
window.$gz.errorHandler.errorToString(res, vm)
|
||||
);
|
||||
@@ -506,12 +503,12 @@ export default {
|
||||
// called once from app.vue only
|
||||
//
|
||||
wireUpEventHandlers(vm) {
|
||||
let self = this;
|
||||
const that = this;
|
||||
//expects extra data (tid) to be { type: [AYATYPE], id: [RECORDID] }
|
||||
window.$gz.eventBus.$on("openobject", function handleOpenObjectClickHandler(
|
||||
tid
|
||||
) {
|
||||
self.handleOpenObjectClick(vm, tid);
|
||||
that.handleOpenObjectClick(vm, tid);
|
||||
});
|
||||
}
|
||||
//new functions above here
|
||||
|
||||
Reference in New Issue
Block a user