🐛 Fixing redirect on create document
This commit is contained in:
parent
4db1e6bb06
commit
4f7d07dcd6
@ -29,13 +29,15 @@ export default function DocumentTypesCreate(props: IProps) {
|
|||||||
});
|
});
|
||||||
const documentToCreate = DocumentType.hydrate<DocumentType>({
|
const documentToCreate = DocumentType.hydrate<DocumentType>({
|
||||||
...values,
|
...values,
|
||||||
office: office
|
office: office,
|
||||||
});
|
});
|
||||||
await validateOrReject(documentToCreate, { groups: ["createDocumentType"] });
|
await validateOrReject(documentToCreate, { groups: ["createDocumentType"] });
|
||||||
const documentTypeCreated = await DocumentTypes.getInstance().post(documentToCreate);
|
const documentTypeCreated = await DocumentTypes.getInstance().post(documentToCreate);
|
||||||
|
|
||||||
router.push(
|
router.push(
|
||||||
Module.getInstance().get().modules.pages.DocumentTypes.pages.Edit.props.path.replace("[uid]", documentTypeCreated.uid!),
|
Module.getInstance()
|
||||||
|
.get()
|
||||||
|
.modules.pages.DocumentTypes.pages.DocumentTypesInformations.props.path.replace("[uid]", documentTypeCreated.uid!),
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Array) {
|
if (e instanceof Array) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user