perf(webui): use addressToComponents to get attribute addresses without querying backend
ci/woodpecker/push/woodpecker Pipeline failed Details

refactor/sveltekit
Tomáš Mládek 2023-11-29 14:10:44 +01:00
parent b5c3e1758b
commit db85fc11a6
2 changed files with 6 additions and 8 deletions

View File

@ -207,11 +207,7 @@ export class UpEndApi {
}
public async getAddress(
input:
| { attribute: string }
| { url: string }
| { urlContent: string }
| ADDRESS_TYPE
input: { urlContent: string } | ADDRESS_TYPE
): Promise<string> {
let response: Response;
if (typeof input === "string") {

View File

@ -23,9 +23,11 @@
if (to.entity) {
targetHref = to.entity;
} else if (to.attribute) {
api.getAddress({ attribute: to.attribute }).then((address) => {
targetHref = address;
});
api
.componentsToAddress({ t: "Attribute", c: to.attribute })
.then((address) => {
targetHref = address;
});
} else if (to.surfaceAttribute) {
targetHref = `surface:${to.surfaceAttribute}`;
}