Format fixes

This commit is contained in:
Richard Bowman 2023-12-01 02:23:58 +00:00
parent 59e0cf5905
commit 5d87a7582e
3 changed files with 8 additions and 4 deletions

View file

@ -143,7 +143,7 @@ export default {
computed: { computed: {
cameraUri: function() { cameraUri: function() {
return `${this.$store.getters.baseUri}/camera/`; return `${this.$store.getters.baseUri}/camera/`;
}, }
} }
}; };
</script> </script>

View file

@ -67,7 +67,11 @@ Vue.mixin({
} }
}, },
thingActionUrl(thing, action) { thingActionUrl(thing, action) {
return this.$store.getters["wot/thingActionUrl"](thing, action, "invokeaction"); return this.$store.getters["wot/thingActionUrl"](
thing,
action,
"invokeaction"
);
}, },
modalConfirm: function(modalText) { modalConfirm: function(modalText) {
var context = this; var context = this;

View file

@ -75,8 +75,7 @@ export const wotStoreModule = {
if ("base" in td) { if ("base" in td) {
let base = td.base; let base = td.base;
if (href.startsWith("/")) href = href.slice(1); if (href.startsWith("/")) href = href.slice(1);
if (!base.endsWith("/")) if (!base.endsWith("/")) base += "/";
base += "/";
return base + href; return base + href;
} }
return href; return href;
@ -96,6 +95,7 @@ export function findFormHref(affordance, op) {
// Find the form in the affordance that matches the given operation type // Find the form in the affordance that matches the given operation type
let forms = affordance.forms; let forms = affordance.forms;
let matchingForm = forms.find(f => f.op == op || f.op.includes(op)); let matchingForm = forms.find(f => f.op == op || f.op.includes(op));
if (matchingForm == undefined) return undefined;
return matchingForm.href; return matchingForm.href;
} }