Просмотр исходного кода

Revert "tmp: disable decorating with associations on revisions"

This reverts commit ac3646836c821cce42c7351d94cdd08151099a43.
Karol Sójko 1 год назад
Родитель
Сommit
ad4b85b095

+ 1 - 1
packages/syncing-server/src/Domain/Handler/ItemRevisionCreationRequestedEventHandler.ts

@@ -24,7 +24,7 @@ export class ItemRevisionCreationRequestedEventHandler implements DomainEventHan
     }
     const itemUuid = itemUuidOrError.getValue()
 
-    const item = await this.itemRepository.findByUuid(itemUuid, true)
+    const item = await this.itemRepository.findByUuid(itemUuid)
     if (item === null) {
       return
     }

+ 1 - 1
packages/syncing-server/src/Domain/Item/ItemRepositoryInterface.ts

@@ -17,7 +17,7 @@ export interface ItemRepositoryInterface {
   findDatesForComputingIntegrityHash(userUuid: string): Promise<Array<{ updated_at_timestamp: number }>>
   findItemsForComputingIntegrityPayloads(userUuid: string): Promise<ExtendedIntegrityPayload[]>
   findByUuidAndUserUuid(uuid: string, userUuid: string): Promise<Item | null>
-  findByUuid(uuid: Uuid, noAssociations: boolean): Promise<Item | null>
+  findByUuid(uuid: Uuid): Promise<Item | null>
   remove(item: Item): Promise<void>
   save(item: Item): Promise<void>
   markItemsAsDeleted(itemUuids: Array<string>, updatedAtTimestamp: number): Promise<void>

+ 1 - 1
packages/syncing-server/src/Domain/UseCase/Syncing/SaveItems/SaveItems.ts

@@ -42,7 +42,7 @@ export class SaveItems implements UseCaseInterface<SaveItemsResult> {
       }
       const itemUuid = itemUuidOrError.getValue()
 
-      const existingItem = await this.itemRepository.findByUuid(itemUuid, false)
+      const existingItem = await this.itemRepository.findByUuid(itemUuid)
 
       if (dto.readOnlyAccess) {
         conflicts.push({

+ 1 - 5
packages/syncing-server/src/Infra/TypeORM/TypeORMItemRepository.ts

@@ -77,7 +77,7 @@ export class TypeORMItemRepository implements ItemRepositoryInterface {
       .execute()
   }
 
-  async findByUuid(uuid: Uuid, noAssociations: boolean): Promise<Item | null> {
+  async findByUuid(uuid: Uuid): Promise<Item | null> {
     const persistence = await this.ormRepository
       .createQueryBuilder('item')
       .where('item.uuid = :uuid', {
@@ -92,10 +92,6 @@ export class TypeORMItemRepository implements ItemRepositoryInterface {
     try {
       const item = this.mapper.toDomain(persistence)
 
-      if (noAssociations) {
-        return item
-      }
-
       await this.decorateItemWithAssociations(item)
 
       return item