|
|
@@ -1,16 +1,11 @@
|
|
|
import { Query as PiniaOrmQuery, Repository } from 'pinia-orm'
|
|
|
-import type { Collection as PiniaOrmCollection } from 'pinia-orm'
|
|
|
import { v4 as uuid4 } from 'uuid'
|
|
|
import * as _ from 'lodash-es'
|
|
|
import ApiRequestService from './apiRequestService'
|
|
|
import UrlUtils from '~/services/utils/urlUtils'
|
|
|
import ApiModel from '~/models/ApiModel'
|
|
|
import ApiResource from '~/models/ApiResource'
|
|
|
-import type {
|
|
|
- AnyJson,
|
|
|
- AssociativeArray,
|
|
|
- Collection,
|
|
|
-} from '~/types/data.d'
|
|
|
+import type { AnyJson, AssociativeArray, Collection } from '~/types/data.d'
|
|
|
import models from '~/models/models'
|
|
|
import HydraNormalizer from '~/services/data/normalizer/hydraNormalizer'
|
|
|
import Query from '~/services/data/Query'
|
|
|
@@ -181,6 +176,7 @@ class EntityManager {
|
|
|
): Promise<ApiResource> {
|
|
|
// If the model instance is already in the store and forceRefresh is false, return the object in store
|
|
|
if (!forceRefresh) {
|
|
|
+ // TODO: est-ce qu'il y a vraiment des situatiosn où on appellera cette méthode sans le forceRefresh?
|
|
|
const item = this.find(model, id)
|
|
|
if (item && typeof item !== 'undefined') {
|
|
|
return item
|
|
|
@@ -233,7 +229,7 @@ class EntityManager {
|
|
|
let piniaOrmQuery = this.getQuery(model)
|
|
|
piniaOrmQuery = query.applyToPiniaOrmQuery(piniaOrmQuery)
|
|
|
|
|
|
- const items = piniaOrmQuery.get()
|
|
|
+ const items = computed(() => piniaOrmQuery.get())
|
|
|
|
|
|
return {
|
|
|
items,
|