From 55917fcabef34a3cdf4ad7d03695cf6d84ae9f02 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 19 May 2025 09:38:01 -0700 Subject: [PATCH] Fix: handle created change with api version increment, use created only on frontend, deprecate created_date (#9962) --- docs/api.md | 6 ++++ .../saved-view-widget.component.html | 2 +- .../document-detail.component.html | 4 +-- .../document-detail.component.ts | 4 +-- .../document-card-large.component.html | 4 +-- .../document-card-small.component.html | 4 +-- .../document-list.component.html | 2 +- src-ui/src/app/data/document.ts | 3 -- .../src/app/services/rest/document.service.ts | 2 -- src-ui/src/environments/environment.prod.ts | 2 +- src/documents/serialisers.py | 23 +++++++++++++ src/documents/tests/test_api_documents.py | 32 +++++++++++++++++++ src/paperless/settings.py | 4 +-- 13 files changed, 74 insertions(+), 18 deletions(-) diff --git a/docs/api.md b/docs/api.md index 44c9a4bc4..ac2789f8b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -418,3 +418,9 @@ Initial API version. - The user field of document notes now returns a simplified user object rather than just the user ID. + +#### Version 9 + +- The document `created` field is now a date, not a datetime. The + `created_date` field is considered deprecated and will be removed in a + future version. diff --git a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html index 305584a64..53fa86dd3 100644 --- a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html @@ -43,7 +43,7 @@ {{doc.added | customDate}} } @case (DisplayField.CREATED) { - {{doc.created_date | customDate}} + {{doc.created | customDate}} } @case (DisplayField.TITLE) { {{doc.title | documentTitle}} diff --git a/src-ui/src/app/components/document-detail/document-detail.component.html b/src-ui/src/app/components/document-detail/document-detail.component.html index 19d6faabb..067246335 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.html +++ b/src-ui/src/app/components/document-detail/document-detail.component.html @@ -129,8 +129,8 @@