Skip to content

Commit

Permalink
Merge pull request #704 from asuc-octo/gql-updated/updatedat-fix
Browse files Browse the repository at this point in the history
added resiliency against variance between updated and updatedAt
  • Loading branch information
maxmwang authored Apr 10, 2024
2 parents ce0413c + 372fda4 commit cd3541f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/src/modules/catalog/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export async function getCatalog(term: TermInput, info: GraphQLResolveInfo): Pro
fromDate: { $lte: getTermStartMonth(term) },
},
{
_updatedAt: 1,
_updated: 1,
identifiers: 1,
title: 1,
Expand Down
2 changes: 1 addition & 1 deletion backend/src/modules/catalog/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { stringToTerm } from "../../utils/term";

export function formatMetadata(data: any) {
return {
lastUpdated: data._updated as Date,
lastUpdated: (!data._updated) ? data._updatedAt as Date : data._updated as Date,
raw: data,
}
}
Expand Down

0 comments on commit cd3541f

Please sign in to comment.