This commit is contained in:
2020-07-31 21:02:47 +00:00
parent d21c03c576
commit 3488740103
3 changed files with 40 additions and 12 deletions

View File

@@ -20,10 +20,39 @@ export default {
});
break;
case ayatype.User:
vm.$router.push({
name: "adm-user",
params: { recordid: tid.id }
});
//Is it an "Inside" user (staff or subcontractor)
//or an "outside" user (customer or headoffice)
//if key doesn't provide this then need to directly find out first before determining which form to redirect to
if (tid.inside == undefined && tid.id != 0) {
//lookup which one to open from server
(async () => {
try {
let res = await window.$gz.api.get(
"user/inside-type/" + tid.id
);
if (res.error) {
throw res.error;
}
if (res.data) {
tid.inside = res.data;
}
} catch (e) {
throw e;
}
})();
}
if (tid.inside == true) {
vm.$router.push({
name: "adm-user",
params: { recordid: tid.id }
});
} else {
vm.$router.push({
name: "customer-user",
params: { recordid: tid.id }
});
}
break;
case ayatype.NotifySubscription:
vm.$router.push({
@@ -38,7 +67,7 @@ export default {
(async () => {
try {
let res = await window.$gz.api.get("attachment/parent/" + tid.id);
console.log("res is", res);
if (res.error) {
throw res.error;
}