Revert "tmp: disable decorating items completely"

This reverts commit bc1c7a8ae1.
This commit is contained in:
Karol Sójko
2023-08-11 12:25:35 +02:00
parent 1ae7cca394
commit 0bf7d8beae
9 changed files with 24 additions and 42 deletions
@@ -8,7 +8,7 @@ export class GetItem implements UseCaseInterface<Item> {
constructor(private itemRepository: ItemRepositoryInterface) {}
async execute(dto: GetItemDTO): Promise<Result<Item>> {
const item = await this.itemRepository.findByUuidAndUserUuid(dto.itemUuid, dto.userUuid, true)
const item = await this.itemRepository.findByUuidAndUserUuid(dto.itemUuid, dto.userUuid)
if (item === null) {
return Result.fail(`Could not find item with uuid ${dto.itemUuid}`)
@@ -56,14 +56,11 @@ export class GetItems implements UseCaseInterface<GetItemsResult> {
)
let items: Array<Item> = []
if (itemUuidsToFetch.length > 0) {
items = await this.itemRepository.findAll(
{
uuids: itemUuidsToFetch,
sortBy: 'updated_at_timestamp',
sortOrder: 'ASC',
},
true,
)
items = await this.itemRepository.findAll({
uuids: itemUuidsToFetch,
sortBy: 'updated_at_timestamp',
sortOrder: 'ASC',
})
}
const totalItemsCount = await this.itemRepository.countAll(itemQuery)
@@ -42,7 +42,7 @@ export class SaveItems implements UseCaseInterface<SaveItemsResult> {
}
const itemUuid = itemUuidOrError.getValue()
const existingItem = await this.itemRepository.findByUuid(itemUuid, true)
const existingItem = await this.itemRepository.findByUuid(itemUuid, false)
if (dto.readOnlyAccess) {
conflicts.push({
@@ -126,15 +126,12 @@ export class SyncItems implements UseCaseInterface<SyncItemsResponse> {
}
private async frontLoadKeysItemsToTop(userUuid: string, retrievedItems: Array<Item>): Promise<Array<Item>> {
const itemsKeys = await this.itemRepository.findAll(
{
userUuid,
contentType: ContentType.TYPES.ItemsKey,
sortBy: 'updated_at_timestamp',
sortOrder: 'ASC',
},
true,
)
const itemsKeys = await this.itemRepository.findAll({
userUuid,
contentType: ContentType.TYPES.ItemsKey,
sortBy: 'updated_at_timestamp',
sortOrder: 'ASC',
})
const retrievedItemsIds: Array<string> = retrievedItems.map((item: Item) => item.id.toString())