1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

fix: unable to update data on tables missing primary or unique key

This commit is contained in:
2022-07-13 09:30:30 +02:00
parent 0891e7be8c
commit e0946f04f7
3 changed files with 310 additions and 18009 deletions

View File

@ -272,6 +272,8 @@ const getSchema = (index: number) => {
};
const getPrimaryValue = (row: any) => {
if (!primaryField.value) return null;
const primaryFieldName = Object.keys(row).find(prop => [
primaryField.value.alias,
primaryField.value.name,
@ -321,7 +323,7 @@ const updateField = (payload: { field: string; type: string; content: any }, row
});
const params = {
primary: primaryField.value.name,
primary: primaryField.value?.name,
schema: getSchema(resultsetIndex.value),
table: getTable(resultsetIndex.value),
id: getPrimaryValue(orgRow),