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:
18302
package-lock.json
generated
18302
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -272,6 +272,8 @@ const getSchema = (index: number) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getPrimaryValue = (row: any) => {
|
const getPrimaryValue = (row: any) => {
|
||||||
|
if (!primaryField.value) return null;
|
||||||
|
|
||||||
const primaryFieldName = Object.keys(row).find(prop => [
|
const primaryFieldName = Object.keys(row).find(prop => [
|
||||||
primaryField.value.alias,
|
primaryField.value.alias,
|
||||||
primaryField.value.name,
|
primaryField.value.name,
|
||||||
@ -321,7 +323,7 @@ const updateField = (payload: { field: string; type: string; content: any }, row
|
|||||||
});
|
});
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
primary: primaryField.value.name,
|
primary: primaryField.value?.name,
|
||||||
schema: getSchema(resultsetIndex.value),
|
schema: getSchema(resultsetIndex.value),
|
||||||
table: getTable(resultsetIndex.value),
|
table: getTable(resultsetIndex.value),
|
||||||
id: getPrimaryValue(orgRow),
|
id: getPrimaryValue(orgRow),
|
||||||
|
@ -606,17 +606,6 @@ watch(() => props.fields, () => {
|
|||||||
watch(isTextareaEditor, (val) => {
|
watch(isTextareaEditor, (val) => {
|
||||||
if (val)
|
if (val)
|
||||||
editorMode.value = langDetector(editingContent.value);
|
editorMode.value = langDetector(editingContent.value);
|
||||||
// const modelOperations = new ModelOperations();
|
|
||||||
// (async () => {
|
|
||||||
// const detected = await modelOperations.runModel(editingContent.value);
|
|
||||||
// const filteredLanguages = detected.filter(dLang =>
|
|
||||||
// availableLanguages.value.some(aLang => aLang.id === dLang.languageId) &&
|
|
||||||
// dLang.confidence > 0.1
|
|
||||||
// );
|
|
||||||
|
|
||||||
// if (filteredLanguages.length)
|
|
||||||
// editorMode.value = availableLanguages.value.find(lang => lang.id === filteredLanguages[0].languageId).slug;
|
|
||||||
// })();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(() => props.selected, (isSelected) => {
|
watch(() => props.selected, (isSelected) => {
|
||||||
|
Reference in New Issue
Block a user