Skip to content

Commit

Permalink
CMS-613: Filter empty notes out of /seasons payload (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncan-oxd authored Jan 14, 2025
1 parent a2054d6 commit d787a3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 7 additions & 0 deletions backend/routes/api/seasons.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ router.get(
model: SeasonChangeLog,
as: "changeLogs",
attributes: ["id", "notes", "createdAt"],
// Filter out empty notes
where: {
notes: {
[Op.ne]: "",
},
},
required: false,
order: [["createdAt", "DESC"]],
include: [
{
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/ChangeLogsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function ChangeLogsList({ changeLogs = [] }) {
</span>
)}
<span className="note-metadata">
{changeLog.notes ? "" : "Submitted "}
{formatDate(changeLog.createdAt, "America/Vancouver")} by{" "}
{changeLog.user.name}
</span>
Expand Down

0 comments on commit d787a3e

Please sign in to comment.