mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 23:28:11 +00:00
fix issue
This commit is contained in:
@@ -84,6 +84,21 @@ export class FilesRepository extends BaseRepository<FileRecord> {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Every version of every document on a resource, oldest first — superseded
|
||||
* versions included. One query for a whole document grid's upload history.
|
||||
*/
|
||||
findAllVersionsByResource(
|
||||
resourceId: string,
|
||||
resource: string,
|
||||
): Promise<FileRecord[]> {
|
||||
return this.repository.find({
|
||||
where: { resourceId, resource },
|
||||
withDeleted: true,
|
||||
order: { createdAt: "ASC" },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Documents belonging to any of the given resources that a reviewer has asked
|
||||
* the customer to correct. Used by the approval gate, so it takes a list of
|
||||
|
||||
@@ -327,6 +327,14 @@ export class FilesService {
|
||||
return this.filesRepository.findByResource(resourceId, resource);
|
||||
}
|
||||
|
||||
/** All versions of every document on a resource (superseded included), oldest first. */
|
||||
findAllVersionsByResource(
|
||||
resourceId: string,
|
||||
resource: string,
|
||||
): Promise<FileRecord[]> {
|
||||
return this.filesRepository.findAllVersionsByResource(resourceId, resource);
|
||||
}
|
||||
|
||||
/**
|
||||
* Files for many resources of one kind, grouped by resource id. Resources with
|
||||
* no files are absent from the map (callers should default to `[]`).
|
||||
|
||||
Reference in New Issue
Block a user