fix(details): altera comportamento do salvamento para não redirecionar e muda texto do botão para Salvar
continuous-integration/webhook Deploy concluído (VPS4)
continuous-integration/webhook Deploy concluído (VPS4)
This commit is contained in:
@@ -159,14 +159,15 @@ export default function ImageDetailsPage() {
|
||||
}
|
||||
setSaving(true);
|
||||
try {
|
||||
await api.post(`/images/${image.id}/transform`, {
|
||||
const { data } = await api.post(`/images/${image.id}/transform`, {
|
||||
rotation: totalRotation,
|
||||
flipH: baseFlipH,
|
||||
flipV: baseFlipV,
|
||||
remark
|
||||
});
|
||||
showToast('Imagem e orientação salvas!', 'success');
|
||||
navigate('/patients'); // Volta para painel após salvar
|
||||
// Atualiza a rota com o novo ID gerado em background (sem adicionar ao histórico de navegação)
|
||||
navigate(`/patients/${encodeURIComponent(patientName)}/image/${data.imageId}`, { replace: true });
|
||||
} catch {
|
||||
showToast('Erro ao salvar orientação', 'error');
|
||||
} finally {
|
||||
@@ -499,7 +500,7 @@ export default function ImageDetailsPage() {
|
||||
disabled={saving}
|
||||
style={{ width: '100%', height: 50, fontSize: '1.1rem', fontWeight: 600, letterSpacing: '0.5px' }}
|
||||
>
|
||||
{saving ? '⏳ Salvando Alterações...' : '💾 Salvar e Voltar'}
|
||||
{saving ? '⏳ Salvando Alterações...' : '💾 Salvar'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user