rename id to addr in AttributeChange types

feat/vaults
Tomáš Mládek 2021-06-27 00:36:55 +02:00
parent 823e4aab30
commit 0d5c20d335
3 changed files with 7 additions and 7 deletions

View File

@ -72,7 +72,7 @@ export default defineComponent({
});
break;
case "delete":
await fetch(`/api/obj/${change.id}`, { method: "DELETE" });
await fetch(`/api/obj/${change.addr}`, { method: "DELETE" });
break;
default:
console.error(`Unimplemented: ${change}`);

View File

@ -90,9 +90,9 @@ export default defineComponent({
this.newEntryAttribute = "";
this.newEntryValue = "";
},
async removeEntry(id: string) {
async removeEntry(addr: string) {
if (confirm("Are you sure you want to remove the attribute?")) {
this.$emit("edit", { type: "delete", id } as AttributeChange);
this.$emit("edit", { type: "delete", addr } as AttributeChange);
}
},
},

View File

@ -36,16 +36,16 @@ export type AttributeChange = AttributeCreate | AttributeUpdate | AttributeDelet
export interface AttributeCreate {
type: "create",
attribute: string,
value: string
value: any
}
export interface AttributeUpdate {
type: "update",
id: string,
value: string
addr: string,
value: any
}
export interface AttributeDelete {
type: "delete",
id: string
addr: string
}