Skip to content

Commit

Permalink
swap out unit.store with unit.service
Browse files Browse the repository at this point in the history
  • Loading branch information
emmysteven committed Nov 6, 2023
1 parent dbc8536 commit 0951de6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions frontend/src/views/Units/AddUnit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h4 class="card-header">Add Cell</h4>
<div class="card-body">

<Form @submit="add" :validation-schema="schema" v-slot="{ errors, loading }">
<Form @submit="create" :validation-schema="schema" v-slot="{ errors, loading }">

<div class="form-group col-md-12 mt-3">
<Field
Expand Down Expand Up @@ -63,11 +63,10 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import * as yup from 'yup';
import { useUnitStore, useUserStore } from '@/stores';
import { unitService } from '@/services';
import { useUserStore } from '@/stores';
const unitStore = useUnitStore()
const userStore = useUserStore()
const loading = ref(false);
const message = ref('');
Expand All @@ -81,10 +80,10 @@ const users = userData.value
onMounted(() => { userStore.fetchAll() });
const add = (data, { resetForm }) => {
const create = (data, { resetForm }) => {
loading.value = true;
unitStore.add(data).then(
unitService.create(data).then(
() => {
loading.value = false;
resetForm();
Expand Down

0 comments on commit 0951de6

Please sign in to comment.