feat: get statuses / priorities from their respective tables

- adds schema.sql
- format entire codebase
This commit is contained in:
Abhinav Raut
2024-08-25 18:29:04 +05:30
parent d20469dab8
commit d647d88502
340 changed files with 7251 additions and 6583 deletions

View File

@@ -9,28 +9,27 @@
import { ref, onMounted } from 'vue'
import GeneralSettingForm from './GeneralSettingForm.vue'
import PageHeader from '../common/PageHeader.vue'
import api from '@/api';
import api from '@/api'
const initialValues = ref({})
onMounted(async () => {
const response = await api.getSettings('general');
const data = response.data.data;
const response = await api.getSettings('general')
const data = response.data.data
initialValues.value = Object.keys(data).reduce((acc, key) => {
// Remove 'app.' prefix
const newKey = key.replace(/^app\./, '');
acc[newKey] = data[key];
return acc;
}, {});
});
const newKey = key.replace(/^app\./, '')
acc[newKey] = data[key]
return acc
}, {})
})
const submitForm = (values) => {
// Prepend keys with `app.`
const updatedValues = Object.fromEntries(
Object.entries(values).map(([key, value]) => [`app.${key}`, value])
);
api.updateSettings('general', updatedValues);
)
api.updateSettings('general', updatedValues)
}
</script>
</script>