chore: removed unused endpoint (#16167)

This commit is contained in:
Jason Rasmussen
2025-02-17 14:07:50 -05:00
committed by GitHub
parent 2c88ce8559
commit 7c26663013
15 changed files with 2 additions and 493 deletions
+1 -45
View File
@@ -1,17 +1,7 @@
import { BadRequestException } from '@nestjs/common';
import { FileReportItemDto } from 'src/dtos/audit.dto';
import {
AssetFileType,
AssetPathType,
DatabaseAction,
EntityType,
JobStatus,
PersonPathType,
UserPathType,
} from 'src/enum';
import { AssetFileType, AssetPathType, JobStatus, PersonPathType, UserPathType } from 'src/enum';
import { AuditService } from 'src/services/audit.service';
import { auditStub } from 'test/fixtures/audit.stub';
import { authStub } from 'test/fixtures/auth.stub';
import { newTestService, ServiceMocks } from 'test/utils';
describe(AuditService.name, () => {
@@ -33,40 +23,6 @@ describe(AuditService.name, () => {
});
});
describe('getDeletes', () => {
it('should require full sync if the request is older than 100 days', async () => {
mocks.audit.getAfter.mockResolvedValue([]);
const date = new Date(2022, 0, 1);
await expect(sut.getDeletes(authStub.admin, { after: date, entityType: EntityType.ASSET })).resolves.toEqual({
needsFullSync: true,
ids: [],
});
expect(mocks.audit.getAfter).toHaveBeenCalledWith(date, {
action: DatabaseAction.DELETE,
userIds: [authStub.admin.user.id],
entityType: EntityType.ASSET,
});
});
it('should get any new or updated assets and deleted ids', async () => {
mocks.audit.getAfter.mockResolvedValue([auditStub.delete.entityId]);
const date = new Date();
await expect(sut.getDeletes(authStub.admin, { after: date, entityType: EntityType.ASSET })).resolves.toEqual({
needsFullSync: false,
ids: ['asset-deleted'],
});
expect(mocks.audit.getAfter).toHaveBeenCalledWith(date, {
action: DatabaseAction.DELETE,
userIds: [authStub.admin.user.id],
entityType: EntityType.ASSET,
});
});
});
describe('getChecksums', () => {
it('should fail if the file is not in the immich path', async () => {
await expect(sut.getChecksums({ filenames: ['foo/bar'] })).rejects.toBeInstanceOf(BadRequestException);