Redirect to detail view of newly created record

This commit is contained in:
Francisco Gaona
2025-12-22 09:55:15 +01:00
parent f4067c56b4
commit cdc202454f
2 changed files with 12 additions and 6 deletions

View File

@@ -308,12 +308,13 @@ export const useViewState = <T extends { id?: string }>(
}
const handleSave = async (data: T) => {
let savedRecord
if (data.id) {
await updateRecord(data.id, data)
savedRecord = await updateRecord(data.id, data)
} else {
await createRecord(data)
savedRecord = await createRecord(data)
}
showDetail(currentRecord.value!)
return savedRecord
}
return {