rename id to addr in AttributeChange types
parent
823e4aab30
commit
0d5c20d335
|
@ -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}`);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue