|
@@ -1,4 +1,4 @@
|
|
|
-import { computed, ComputedRef } from '@nuxtjs/composition-api'
|
|
|
|
|
|
|
+import {computed, ComputedRef, useStore} from '@nuxtjs/composition-api'
|
|
|
import { Item, Model } from '@vuex-orm/core'
|
|
import { Item, Model } from '@vuex-orm/core'
|
|
|
import { repositoryHelper } from '~/services/store/repository'
|
|
import { repositoryHelper } from '~/services/store/repository'
|
|
|
import { QUERY_TYPE } from '~/types/enums'
|
|
import { QUERY_TYPE } from '~/types/enums'
|
|
@@ -18,8 +18,9 @@ export class UseMyProfileUpdater {
|
|
|
private $dataPersister!:DataPersister
|
|
private $dataPersister!:DataPersister
|
|
|
private myProfile!:MyProfile
|
|
private myProfile!:MyProfile
|
|
|
|
|
|
|
|
- constructor (store:AnyStore, $dataPersister:DataPersister) {
|
|
|
|
|
- this.store = store
|
|
|
|
|
|
|
+ constructor () {
|
|
|
|
|
+ this.store = useStore()
|
|
|
|
|
+ const {$dataPersister} = useContext()
|
|
|
this.$dataPersister = $dataPersister
|
|
this.$dataPersister = $dataPersister
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -27,8 +28,6 @@ export class UseMyProfileUpdater {
|
|
|
* Composition function
|
|
* Composition function
|
|
|
*/
|
|
*/
|
|
|
public invoke (): AnyJson {
|
|
public invoke (): AnyJson {
|
|
|
-
|
|
|
|
|
- const {$ability} = useContext()
|
|
|
|
|
const currentAccessId = $accessProfile(this.store).getCurrentAccessId()
|
|
const currentAccessId = $accessProfile(this.store).getCurrentAccessId()
|
|
|
|
|
|
|
|
this.myProfile = this.getMyProfileInstance(currentAccessId) as MyProfile
|
|
this.myProfile = this.getMyProfileInstance(currentAccessId) as MyProfile
|
|
@@ -112,4 +111,4 @@ export class UseMyProfileUpdater {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export const $useMyProfileUpdater = (store:AnyStore, $dataPersister:DataPersister) => new UseMyProfileUpdater(store, $dataPersister).invoke()
|
|
|
|
|
|
|
+export const $useMyProfileUpdater = () => new UseMyProfileUpdater().invoke()
|