Fixed Typescript build errors.

This commit is contained in:
Fabio Manganiello 2025-03-09 11:13:20 +01:00
parent 7e6ac7583d
commit 5f39251acc
Signed by: blacklight
GPG key ID: D90FBA7F76362774
3 changed files with 11 additions and 4 deletions
frontend/src

View file

@ -28,7 +28,7 @@
</template>
<script lang="ts">
import { Optional } from '../../models/Types';
import { type Optional } from '../../models/Types';
import Api from '../../mixins/Api.vue';
import Loading from '../../elements/Loading.vue';
import Notifications from '../../mixins/Notifications.vue';
@ -59,9 +59,15 @@ export default {
}
},
computed: {
nameElement() {
return this.$refs.name as HTMLInputElement;
},
},
methods: {
async sync() {
const name = this.$refs.name.value.trim();
const name = this.nameElement.value.trim();
if (!name?.length) {
this.notify({
content: 'Please enter a name for your device.',
@ -92,7 +98,7 @@ export default {
},
async mounted() {
this.$refs.name.focus();
this.nameElement.focus();
},
}
</script>

View file

@ -2,6 +2,7 @@
export default {
methods: {
notify(payload: any) {
// @ts-ignore
this.$msgBus.emit('message', payload);
},
},

View file

@ -25,7 +25,7 @@ export default {
method: 'PATCH',
body: Object.keys(device).reduce((acc, key) => {
if (!['id', 'userId', 'createdAt', 'updatedAt'].includes(key)) {
acc[key] = device[key];
acc[key] = (device as any)[key];
}
return acc;