Skip to content

Commit

Permalink
using useForm composable which contains updateForm instead of writing…
Browse files Browse the repository at this point in the history
… one
  • Loading branch information
rob-a-ubiquity committed Sep 10, 2024
1 parent 4cba851 commit 8e4ed59
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/pages/workflow/workflowLogResponseForModalStore.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import {inject} from 'vue';
import {defineComponentStore} from '@/utils/defineComponentStore';
import {useForm} from '@/composables/useForm';

export const useWorkflowLogResponseForModalStore = defineComponentStore(
'workflowLogResponseForModal',
(props) => {
const closeModal = inject('closeModal');
const form = props.logResponseForm;
const {set: updateForm, form} = useForm(props.logResponseForm);

function formSuccess() {
closeModal();
}

function updateForm(formId, data) {
Object.keys(data).forEach((key) => (form[key] = data[key]));
}

return {form, formSuccess, updateForm};
},
);

0 comments on commit 8e4ed59

Please sign in to comment.