You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
468 B

2 years ago
  1. import { reactive, useContext } from '@nuxtjs/composition-api'
  2. import { Project } from '~/domain/models/project/project'
  3. export const useProjectItem = () => {
  4. const state = reactive({
  5. project: {} as Project
  6. })
  7. const { app } = useContext()
  8. const projectService = app.$services.project
  9. const getProjectById = async (projectId: string) => {
  10. state.project = await projectService.findById(projectId)
  11. }
  12. return {
  13. state,
  14. getProjectById
  15. }
  16. }