mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 07:38:53 +02:00
fix(views/table): wrong type when renaming relations
This commit is contained in:
parent
ef1153d336
commit
ba5ef93c1a
@ -78,14 +78,14 @@ export default class TableColumnEditing extends Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { name, type, value } = this.newAttribute;
|
const { name, value } = this.newAttribute;
|
||||||
|
|
||||||
this.api.blockRedraw();
|
this.api.blockRedraw();
|
||||||
try {
|
try {
|
||||||
if (this.existingAttributeToEdit && this.existingAttributeToEdit.name !== name) {
|
if (this.existingAttributeToEdit && this.existingAttributeToEdit.name !== name) {
|
||||||
const oldName = this.existingAttributeToEdit.name.split(":")[1];
|
const oldName = this.existingAttributeToEdit.name.split(":")[1];
|
||||||
const newName = name.split(":")[1];
|
const [ type, newName ] = name.split(":");
|
||||||
await renameColumn(this.parentNote.noteId, type, oldName, newName);
|
await renameColumn(this.parentNote.noteId, type as "label" | "relation", oldName, newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
attributes.setLabel(this.parentNote.noteId, name, value);
|
attributes.setLabel(this.parentNote.noteId, name, value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user