mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): client emit events (#12606)
* refactor(server): client emit events * chore: test coverage
This commit is contained in:
parent
7b737786b3
commit
ba57646f9f
8 changed files with 142 additions and 20 deletions
|
|
@ -5,7 +5,7 @@ import { AuthDto } from 'src/dtos/auth.dto';
|
|||
import { Permission } from 'src/enum';
|
||||
import { IAccessRepository } from 'src/interfaces/access.interface';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.interface';
|
||||
import { ClientEvent, IEventRepository } from 'src/interfaces/event.interface';
|
||||
import { IEventRepository } from 'src/interfaces/event.interface';
|
||||
import { IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName } from 'src/interfaces/job.interface';
|
||||
import { requireAccess } from 'src/utils/access';
|
||||
import { usePagination } from 'src/utils/pagination';
|
||||
|
|
@ -64,6 +64,6 @@ export class TrashService {
|
|||
}
|
||||
|
||||
await this.assetRepository.restoreAll(ids);
|
||||
this.eventRepository.clientSend(ClientEvent.ASSET_RESTORE, auth.user.id, ids);
|
||||
await this.eventRepository.emit('assets.restore', { assetIds: ids, userId: auth.user.id });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue