WIP - permissions progress

This commit is contained in:
Francisco Gaona
2025-12-30 03:26:50 +01:00
parent f4143ab106
commit b4bdeeb9f6
22 changed files with 1565 additions and 99 deletions

View File

@@ -137,7 +137,12 @@ const validateForm = (): boolean => {
const handleSave = () => {
if (validateForm()) {
emit('save', { ...formData.value })
// Start with props.data to preserve system fields like id, then override with user edits
const dataToSave = {
...props.data,
...formData.value,
}
emit('save', dataToSave)
}
}

View File

@@ -160,11 +160,10 @@ const validateForm = (): boolean => {
const handleSave = () => {
if (validateForm()) {
// Filter out system fields from save data
const saveData = { ...formData.value }
const systemFields = ['id', 'tenantId', 'ownerId', 'created_at', 'updated_at', 'createdAt', 'updatedAt', 'createdBy', 'updatedBy']
for (const field of systemFields) {
delete saveData[field]
// Start with props.data to preserve system fields like id, then override with user edits
const saveData = {
...props.data,
...formData.value,
}
emit('save', saveData)
}