Skip to content

Commit

Permalink
fix(dashboard/admin-single-user-view): type check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeNamedRobin committed Aug 28, 2024
1 parent d8f3fc2 commit 52d4e29
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion apps/dashboard/src/components/InputSpan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ const props = defineProps({
const emit = defineEmits(['update:value']);
const stringInputs = ['text', 'textarea'];
const numberInputs = ['currency', 'percentage', 'number'];
const numberInputs = ['currency', 'number', 'usertype', 'percentage'];
const booleanInputs = ['boolean'];
const initialValue = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<script setup lang="ts">
import FormCard from "@/components/FormCard.vue";
import {onBeforeMount, onMounted, type PropType, type Ref, ref, watch} from "vue";
import { onMounted, type PropType, ref, watch} from "vue";
import type { UserResponse } from "@sudosos/sudosos-client";
import { schemaToForm } from "@/utils/formUtils";
import { updateUserDetailsObject, userTypes } from "@/utils/validation-schema";
Expand All @@ -26,7 +26,6 @@ const props = defineProps({
});
const edit = ref(false);
const user: Ref<UserResponse> = ref(props.user);
const form = schemaToForm(updateUserDetailsObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import AdminUserInfoCard from "@/modules/admin/components/users/AdminUserInfoCar
const route = useRoute();
const userStore = useUserStore();
const toast = useToast();
const currentUser: Ref<UserResponse | undefined> = ref();
const currentUser: Ref<UserResponse> = ref<UserResponse>(null!);
onBeforeMount(async () => {
await apiService.user.getIndividualUser(Number(route.params.userId)).then((res) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/utils/validation-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const updateUserDetailsObject = yup.object({
lastName: yup.string(),
email: yup.string().email(),
nickname: yup.string(),
userType: yup.mixed().required(),
userType: yup.number().required(),
isActive: yup.boolean().required().default(true),
ofAge: yup.boolean().required().default(false),
canGoIntoDebt: yup.boolean().required().default(false),
Expand Down

0 comments on commit 52d4e29

Please sign in to comment.