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

30 lines
554 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.data);
2024-08-01 17:30:55 +02:00
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: {
default: () => {
return {data: [], meta: {}};
2024-08-01 17:30:55 +02:00
},
type: Object,
2024-08-01 17:30:55 +02:00
},
};
export {props};