Fix people creation redirect to a not found page
Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
@@ -89,7 +89,7 @@ function CreatePeoplePageContent() {
|
||||
e.preventDefault();
|
||||
const peopleConnectionId = ConnectionHandler.getConnectionID(
|
||||
organizationId!,
|
||||
"PeopleListPage_peoples",
|
||||
"PeopleListPage_peoples"
|
||||
);
|
||||
|
||||
createPeople({
|
||||
@@ -109,7 +109,9 @@ function CreatePeoplePageContent() {
|
||||
description: "Person created successfully",
|
||||
variant: "default",
|
||||
});
|
||||
navigate(`/peoples/${response.createPeople.peopleEdge.node.id}`);
|
||||
navigate(
|
||||
`/organizations/${organizationId}/peoples/${response.createPeople.peopleEdge.node.id}`
|
||||
);
|
||||
},
|
||||
onError: (error) => {
|
||||
toast({
|
||||
@@ -165,7 +167,7 @@ function CreatePeoplePageContent() {
|
||||
newEmails[index] = e.target.value;
|
||||
handleFieldChange(
|
||||
"additionalEmailAddresses",
|
||||
newEmails,
|
||||
newEmails
|
||||
);
|
||||
}}
|
||||
/>
|
||||
@@ -175,11 +177,11 @@ function CreatePeoplePageContent() {
|
||||
onClick={() => {
|
||||
const newEmails =
|
||||
formData.additionalEmailAddresses.filter(
|
||||
(_, i) => i !== index,
|
||||
(_, i) => i !== index
|
||||
);
|
||||
handleFieldChange(
|
||||
"additionalEmailAddresses",
|
||||
newEmails,
|
||||
newEmails
|
||||
);
|
||||
}}
|
||||
>
|
||||
@@ -227,7 +229,7 @@ function CreatePeoplePageContent() {
|
||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||
formData.kind === "EMPLOYEE"
|
||||
? "bg-blue-100 text-blue-900 ring-2 ring-blue-600 ring-offset-2"
|
||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
||||
)}
|
||||
>
|
||||
Employee
|
||||
@@ -239,7 +241,7 @@ function CreatePeoplePageContent() {
|
||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||
formData.kind === "CONTRACTOR"
|
||||
? "bg-purple-100 text-purple-900 ring-2 ring-purple-600 ring-offset-2"
|
||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
||||
)}
|
||||
>
|
||||
Contractor
|
||||
|
||||
Reference in New Issue
Block a user