Files
standardnotes-app-web/packages/services/src/Domain/UseCase/DiscardItemsLocally.ts
Mo 4a29e2a24c chore: upgrade eslint and prettier (#2376)
* chore: upgrade eslint and prettier

* chore: add restrict-template-expressions
2023-07-27 14:36:05 -05:00

18 lines
583 B
TypeScript

import { StorageServiceInterface } from '../Storage/StorageServiceInterface'
import { ItemManagerInterface } from '../Item/ItemManagerInterface'
import { AnyItemInterface } from '@standardnotes/models'
import { Uuids } from '@standardnotes/utils'
export class DiscardItemsLocally {
constructor(
private readonly items: ItemManagerInterface,
private readonly storage: StorageServiceInterface,
) {}
async execute(items: AnyItemInterface[]): Promise<void> {
this.items.removeItemsFromMemory(items)
await this.storage.deletePayloadsWithUuids(Uuids(items))
}
}