From e4c7cf27d770ef6bf2c8edcc5e6bb6e15e6db87a Mon Sep 17 00:00:00 2001 From: Hironsan Date: Thu, 23 Feb 2023 13:16:43 +0900 Subject: [PATCH] Remove user application service --- frontend/components/member/FormCreate.vue | 13 ++++---- .../tasks/toolbar/forms/FormComment.vue | 7 ++-- frontend/domain/models/user/userRepository.ts | 7 ---- frontend/nuxt.config.js | 1 + frontend/plugins/repositories.ts | 32 +++++++++---------- frontend/plugins/services.ts | 3 -- .../repositories/user/apiUserRepository.ts | 7 ++-- .../user/userApplicationService.ts | 16 ---------- .../services/application/user/userData.ts | 13 -------- frontend/store/auth.js | 2 +- 10 files changed, 32 insertions(+), 69 deletions(-) delete mode 100644 frontend/domain/models/user/userRepository.ts delete mode 100644 frontend/services/application/user/userApplicationService.ts delete mode 100644 frontend/services/application/user/userData.ts diff --git a/frontend/components/member/FormCreate.vue b/frontend/components/member/FormCreate.vue index 0981f146..119f5dc0 100644 --- a/frontend/components/member/FormCreate.vue +++ b/frontend/components/member/FormCreate.vue @@ -56,9 +56,9 @@ import { mdiAccount, mdiCreditCardOutline } from '@mdi/js' import type { PropType } from 'vue' import Vue from 'vue' import BaseCard from '@/components/utils/BaseCard.vue' +import { UserItem } from '~/domain/models/user/user' import { MemberDTO } from '~/services/application/member/memberData' import { RoleDTO } from '~/services/application/role/roleData' -import { UserDTO } from '~/services/application/user/userData' export default Vue.extend({ components: { @@ -80,11 +80,11 @@ export default Vue.extend({ return { isLoading: false, valid: false, - users: [] as UserDTO[], + users: [] as UserItem[], roles: [] as RoleDTO[], username: '', rules: { - userRequired: (v: UserDTO) => (!!v && !!v.username) || 'Required', + userRequired: (v: UserItem) => (!!v && !!v.username) || 'Required', roleRequired: (v: RoleDTO) => (!!v && !!v.rolename) || 'Required' }, mdiAccount, @@ -94,17 +94,18 @@ export default Vue.extend({ async fetch() { this.isLoading = true - this.users = await this.$services.user.list(this.username) + this.users = await this.$repositories.user.list(this.username) this.isLoading = false }, computed: { user: { - get(): UserDTO { + get(): UserItem { return { id: this.value.user, username: this.value.username, - isStaff: false + isStaff: false, + isSuperuser: false } }, set(val: MemberDTO) { diff --git a/frontend/components/tasks/toolbar/forms/FormComment.vue b/frontend/components/tasks/toolbar/forms/FormComment.vue index dfd3af6d..06c2ec2c 100644 --- a/frontend/components/tasks/toolbar/forms/FormComment.vue +++ b/frontend/components/tasks/toolbar/forms/FormComment.vue @@ -20,9 +20,10 @@