fix(produser): changes for planning default user
This commit is contained in:
@@ -66,7 +66,7 @@ export const prodUser = async (data: any) => {
|
|||||||
rolesLegacy: permRoleCheck[0].rolesLegacy,
|
rolesLegacy: permRoleCheck[0].rolesLegacy,
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data: newU, error: newE } = await tryCatch(
|
const { data: newU, error: newE } = (await tryCatch(
|
||||||
axios.post(newurl, newUser, {
|
axios.post(newurl, newUser, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Basic ${btoa(
|
Authorization: `Basic ${btoa(
|
||||||
@@ -75,10 +75,15 @@ export const prodUser = async (data: any) => {
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
)) as any;
|
||||||
|
|
||||||
if (newE) {
|
if (newE) {
|
||||||
console.log(newE);
|
console.log(newE);
|
||||||
|
return {
|
||||||
|
succes: false,
|
||||||
|
message: `${data.username} encountered an error creating..`,
|
||||||
|
data: newE.response.data,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const newProdRoles: any = [
|
|||||||
{
|
{
|
||||||
name: "planning",
|
name: "planning",
|
||||||
description: "Planning viewer only",
|
description: "Planning viewer only",
|
||||||
roles: ["OperationsPlanning\\ProductionScheduling\\ProductionViewer"],
|
roles: ["Manufacturing\\IssueMaterial\\MaterialHandler"],
|
||||||
rolesLegacy: [3],
|
rolesLegacy: [3],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user