Browse Source

Add member service to plugin

pull/1224/head
Hironsan 3 years ago
parent
commit
3e33d980dd
1 changed files with 8 additions and 2 deletions
  1. 10
      frontend/plugins/services.ts

10
frontend/plugins/services.ts

@ -1,9 +1,12 @@
import { Plugin } from '@nuxt/types' import { Plugin } from '@nuxt/types'
import { FromApiLabelItemListRepository } from '@/repositories/label/api' import { FromApiLabelItemListRepository } from '@/repositories/label/api'
import { FromApiMemberItemListRepository } from '@/repositories/member/api'
import { LabelApplicationService } from '@/services/application/label.service' import { LabelApplicationService } from '@/services/application/label.service'
import { MemberApplicationService } from '@/services/application/member.service'
export interface Services { export interface Services {
label: LabelApplicationService
label: LabelApplicationService,
member: MemberApplicationService
} }
declare module 'vue/types/vue' { declare module 'vue/types/vue' {
@ -15,8 +18,11 @@ declare module 'vue/types/vue' {
const plugin: Plugin = (context, inject) => { const plugin: Plugin = (context, inject) => {
const labelRepository = new FromApiLabelItemListRepository() const labelRepository = new FromApiLabelItemListRepository()
const label = new LabelApplicationService(labelRepository) const label = new LabelApplicationService(labelRepository)
const memberRepository = new FromApiMemberItemListRepository()
const member = new MemberApplicationService(memberRepository)
const services: Services = { const services: Services = {
label
label,
member
} }
inject('services', services) inject('services', services)
} }

Loading…
Cancel
Save