Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/apis/azul/anvil-cmg/common/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export interface DonorSpecies {
*/
export interface FileEntity {
accessible: boolean;
azul_url: string;
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new azul_url property is defined as non-nullable string, while the removed url property was also string. Consider whether this field should allow null values for consistency with the HCA-DCP implementation, especially if the underlying API might not always provide a URL.

Suggested change
azul_url: string;
azul_url: string | null;

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MillenniumFalconMechanic HCA had a TODO comment regarding the url property (whether null was a possible value). I'm happy to type azule_url as string | null if you think it is appropriate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting; there must be downstream handling (i.e. type narrowing) on the possible null values? Let's keep it as it was (string | null) but remove the TODO comments.

data_modality: string[];
date_created: string;
document_id: string;
Expand All @@ -98,7 +99,6 @@ export interface FileEntity {
file_name: string;
file_size: number;
file_type: string;
url: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed url to ensure it isn't used accidentally (generates TS error if it is).

}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/apis/azul/hca-dcp/common/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface FilesEntityResponse {
*/
export interface FileResponse {
accessible: boolean;
azul_url: string;
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new azul_url property is defined as non-nullable string, while the removed url property was string | null. If the API can return null values for this field, this type definition could cause runtime errors. Verify the API response guarantees a non-null value, or update the type to string | null to maintain backward compatibility.

Suggested change
azul_url: string;
azul_url: string | null;

Copilot uses AI. Check for mistakes.
contentDescription: (string | null)[];
drs_uri: string;
fileSource: string | null;
Expand All @@ -50,7 +51,6 @@ export interface FileResponse {
name: string;
sha256: string;
size: number;
url: string | null; // TODO confirm null is possible.
uuid: string;
version: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ export const buildFileDownload = (
entityName: processEntityValue(response.files, "file_name"),
relatedEntityId: dataset.dataset_id[0],
relatedEntityName: dataset.title[0],
url: processEntityValue(response.files, "url", LABEL.EMPTY),
url: processEntityValue(response.files, "azul_url", LABEL.EMPTY),
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ export const buildFileDownload = (
entityName: processEntityValue(filesResponse.files, "name"),
relatedEntityId: project.projectId[0],
relatedEntityName: project.projectTitle[0],
url: processEntityValue(filesResponse.files, "url", LABEL.EMPTY),
url: processEntityValue(filesResponse.files, "azul_url", LABEL.EMPTY),
};
};

Expand Down
Loading