diff --git a/ui/src/components/AttributeView.vue b/ui/src/components/AttributeView.vue index de0612f..6407de3 100644 --- a/ui/src/components/AttributeView.vue +++ b/ui/src/components/AttributeView.vue @@ -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}`); diff --git a/ui/src/components/widgets/Table.vue b/ui/src/components/widgets/Table.vue index 13f607c..6c0b647 100644 --- a/ui/src/components/widgets/Table.vue +++ b/ui/src/components/widgets/Table.vue @@ -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); } }, }, diff --git a/ui/src/types/base.ts b/ui/src/types/base.ts index ba7a0ab..48a4565 100644 --- a/ui/src/types/base.ts +++ b/ui/src/types/base.ts @@ -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 } \ No newline at end of file