fix(rotas): cadastrar alias /ordens-fabricacao e corrigir botao voltar no cadastro de pecas

This commit is contained in:
Marcos Reifonas
2026-10-08 07:32:15 -03:00
parent 161f73edd6
commit d177184a62
2 changed files with 15 additions and 1 deletions
+6
View File
@@ -118,6 +118,12 @@ export const routeConfig: RouteDefinition[] = [
guard: 'resource',
resourceKey: 'ofs-lista',
},
{
path: '/ordens-fabricacao',
component: () => import('@/pages/OrdensFabricacao'),
guard: 'resource',
resourceKey: 'ofs-lista',
},
{
path: '/ofs/cronograma',
component: () => import('@/pages/CronogramaOF'),
+9 -1
View File
@@ -193,6 +193,14 @@ export default function CadastroPecasFiltrado() {
);
}
const handleVoltar = () => {
if (window.history.state && window.history.state.idx > 0) {
navigate(-1);
} else {
navigate('/seletor-of');
}
};
if (!ofSelecionada) {
return null;
}
@@ -206,7 +214,7 @@ export default function CadastroPecasFiltrado() {
<div className="flex gap-2">
<Button
variant="outline"
onClick={() => navigate('/ordens-fabricacao')}
onClick={handleVoltar}
className="flex items-center gap-2"
>
<ArrowLeft className="h-4 w-4" />