format code

This commit is contained in:
Simon Vieille
2025-04-13 20:33:03 +02:00
parent fdd8f8850d
commit b835bbb34d
7 changed files with 74 additions and 56 deletions
+19 -17
View File
@@ -3,25 +3,20 @@
<NcButton
variant="success"
@click="save"
>
<template v-if="!loading">
{{ t('side_menu', 'Save') }}
</template>
<NcLoadingIcon v-else />
>
<template v-if="!loading">
{{ t('side_menu', 'Save') }}
</template>
<NcLoadingIcon v-else />
</NcButton>
<div v-if="error" id="error">
</div>
<div
v-if="error"
id="error"
></div>
</div>
</template>
<style scoped>
#error {
padding-top: 10px;
color: red;
}
</style>
<script setup>
import { NcButton, NcLoadingIcon } from '@nextcloud/vue'
import { ref } from 'vue'
@@ -56,7 +51,7 @@ const save = async () => {
error.value = null
const update = () => {
++counter;
++counter
if (counter === size) {
loading.value = false
@@ -71,9 +66,9 @@ const save = async () => {
let value = data[key]
let formData = []
if (Array.isArray(value) || typeof(value) === 'object') {
if (Array.isArray(value) || typeof value === 'object') {
value = JSON.stringify(value)
} else if (typeof(value) === 'boolean') {
} else if (typeof value === 'boolean') {
value = value ? 1 : 0
}
@@ -95,3 +90,10 @@ const save = async () => {
}
}
</script>
<style scoped>
#error {
padding-top: 10px;
color: red;
}
</style>