rename id to addr in AttributeChange types
This commit is contained in:
parent
823e4aab30
commit
0d5c20d335
3 changed files with 7 additions and 7 deletions
|
@ -72,7 +72,7 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "delete":
|
case "delete":
|
||||||
await fetch(`/api/obj/${change.id}`, { method: "DELETE" });
|
await fetch(`/api/obj/${change.addr}`, { method: "DELETE" });
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.error(`Unimplemented: ${change}`);
|
console.error(`Unimplemented: ${change}`);
|
||||||
|
|
|
@ -90,9 +90,9 @@ export default defineComponent({
|
||||||
this.newEntryAttribute = "";
|
this.newEntryAttribute = "";
|
||||||
this.newEntryValue = "";
|
this.newEntryValue = "";
|
||||||
},
|
},
|
||||||
async removeEntry(id: string) {
|
async removeEntry(addr: string) {
|
||||||
if (confirm("Are you sure you want to remove the attribute?")) {
|
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 {
|
export interface AttributeCreate {
|
||||||
type: "create",
|
type: "create",
|
||||||
attribute: string,
|
attribute: string,
|
||||||
value: string
|
value: any
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AttributeUpdate {
|
export interface AttributeUpdate {
|
||||||
type: "update",
|
type: "update",
|
||||||
id: string,
|
addr: string,
|
||||||
value: string
|
value: any
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AttributeDelete {
|
export interface AttributeDelete {
|
||||||
type: "delete",
|
type: "delete",
|
||||||
id: string
|
addr: string
|
||||||
}
|
}
|
Loading…
Reference in a new issue