adrema/resources/js/views/setting/useSettings.js

39 lines
693 B
JavaScript
Raw Normal View History

2024-08-01 18:25:25 +02:00
import {useIndex} from '../../composables/useInertiaApiIndex.js';
2024-08-01 17:30:55 +02:00
import SettingLayout from './Layout.vue';
export function useSettings(props) {
const {data, meta, router} = useIndex(props);
function submit() {
2024-08-01 18:25:25 +02:00
router.post(meta.value.links.store, {...data.value});
2024-08-01 17:30:55 +02:00
}
return {
submit,
data,
meta,
props,
SettingLayout,
};
}
const props = {
data: {
type: Object,
required: true,
},
settingMenu: {
type: Object,
required: true,
},
meta: {
type: Object,
required: false,
default: () => {
return {};
},
},
};
export {props};