tmp: disable decorating items completely

This commit is contained in:
Karol Sójko
2023-08-11 10:54:12 +02:00
parent c22c5e4584
commit bc1c7a8ae1
9 changed files with 42 additions and 24 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)
const item = await this.itemRepository.findByUuidAndUserUuid(dto.itemUuid, dto.userUuid, true)
if (item === null) {
return Result.fail(`Could not find item with uuid ${dto.itemUuid}`)
@@ -56,11 +56,14 @@ 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',
})
items = await this.itemRepository.findAll(
{
uuids: itemUuidsToFetch,
sortBy: 'updated_at_timestamp',
sortOrder: 'ASC',
},
true,
)
}
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, false)
const existingItem = await this.itemRepository.findByUuid(itemUuid, true)
if (dto.readOnlyAccess) {
conflicts.push({
@@ -126,12 +126,15 @@ 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',
})
const itemsKeys = await this.itemRepository.findAll(
{
userUuid,
contentType: ContentType.TYPES.ItemsKey,
sortBy: 'updated_at_timestamp',
sortOrder: 'ASC',
},
true,
)
const retrievedItemsIds: Array<string> = retrievedItems.map((item: Item) => item.id.toString())