Skip to content

Commit 5e1eaba

Browse files
add download validate date filter, add validate filter process
1 parent 717c86d commit 5e1eaba

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

backend-app/archive/services.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ def _make_archive(project: Project, request: Request) -> tuple[dict[str, Any], i
5050
"status": request_query.get("card[]", []),
5151
"only_new": only_new,
5252
"type": request_query.get("type[]", []),
53-
"attributes": list(attributes)
53+
"attributes": list(attributes),
54+
"upload_from": request_query.get("from"),
55+
"upload_to": request_query.get("to"),
56+
"update_from": request_query.get("validate_from"),
57+
"update_to": request_query.get("validate_to"),
5458
}
5559

5660
files, _ = FileService()._get_files(project.id, request.user, request_query, True)

backend-app/file/services.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class ViewSetServices:
3838
("status", "status", False),
3939
("author__in", "author[]", True),
4040
("upload_date__gte", "from", False),
41-
("upload_date__lte", "to", False)
41+
("upload_date__lte", "to", False),
42+
("update_date__gte", "validate_from", False),
43+
("update_date__lte", "validate_to", False)
4244
)
4345

4446
def _patch_file(

frontend-app/src/components/FilesDownload/index.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ export default function FilesDownload({ pathID, attributes }) {
5454
prettyName: "Upload date Filter:",
5555
name: "date",
5656
type: "date",
57+
},
58+
{
59+
prettyName: "Validate date Filter:",
60+
name: "validate",
61+
type: "date",
5762
}
5863
], [attributes]);
5964

@@ -86,6 +91,10 @@ export default function FilesDownload({ pathID, attributes }) {
8691
payload.from = payload.date.from;
8792
payload.to = payload.date.to;
8893
}
94+
if (payload.validate) {
95+
payload.validate_from = payload.validate.from;
96+
payload.validate_to = payload.validate.to;
97+
}
8998

9099
var { data } = await api.post(`/api/projects/archive/${pathID}/`, payload, {
91100
headers: { Authorization: "Bearer " + localStorage.getItem("dtcAccess") },

0 commit comments

Comments
 (0)