Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection page updates #253

Merged
merged 5 commits into from
Nov 20, 2024
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
34 changes: 0 additions & 34 deletions backend/src/entity/CollectionFileResponse.ts

This file was deleted.

25 changes: 0 additions & 25 deletions backend/src/entity/CollectionResponse.ts

This file was deleted.

6 changes: 0 additions & 6 deletions backend/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Upload } from "../entity/Upload";
import axios from "axios";
import { SiteType } from "../entity/Site";
import env from "./env";
import { CollectionFileResponse } from "../entity/CollectionFileResponse";
import ReadableStream = NodeJS.ReadableStream;
import maxmind, { CountryResponse, OpenOpts, Reader } from "maxmind";
import { randomBytes } from "crypto";
Expand Down Expand Up @@ -71,11 +70,6 @@ export const convertToSearchResponse = (file: SearchFile) => new SearchFileRespo
export const convertToReducedResponse = (parameters: (keyof SearchFileResponse)[]) => (file: SearchFile) =>
parameters.reduce((acc, cur) => ({ ...acc, [cur]: convertToSearchResponse(file)[cur] }), {});

export const convertToCollectionFileResponse = (file: RegularFile | ModelFile) => new CollectionFileResponse(file);

export const sortByMeasurementDateAsc = <T extends File | SearchFile>(files: T[]): T[] =>
files.sort((a, b) => new Date(a.measurementDate).getTime() - new Date(b.measurementDate).getTime());

export const augmentFile = (includeS3path: boolean) => (file: RegularFile | ModelFile) => ({
...file,
downloadUrl: `${env.DP_BACKEND_URL}/download/${getDownloadPathForFile(file)}`,
Expand Down
1 change: 0 additions & 1 deletion backend/src/lib/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export class Middleware {
"dvasUpdated",
"page",
"pageSize",
"collection",
];

if (req.path.includes("visualization")) validKeys.push("variable");
Expand Down
Loading