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