Movie last update time #2

Merged
quoije merged 2 commits from cursor/movie-last-update-time-6461 into 2026 2025-12-20 16:32:22 -05:00
quoije commented 2025-12-20 16:30:15 -05:00 (Migrated from github.com)

Add Mongoose timestamps to the Movie schema to track creation and update times.


Open in Cursor Open in Web


Note

Add Mongoose timestamps to Movie, introduce authenticated GET /movies/last-update returning ISO timestamp, and add frontend element id to show last update.

  • Backend:
    • Schema: Enable timestamps: true on models/Movie to track createdAt/updatedAt.
    • API: Add GET /movies/last-update with JWT auth; returns { lastUpdated: <ISO> } derived from updatedAt/createdAt/_id timestamp.
  • Frontend:
    • Movies page: add id="movies-last-updated" element to display last update time.

Written by Cursor Bugbot for commit 0d35a19cc5. This will update automatically on new commits. Configure here.

Add Mongoose timestamps to the Movie schema to track creation and update times. --- <a href="https://cursor.com/background-agent?bcId=bc-842c4af0-74e1-482b-9910-a15047f650c4"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-842c4af0-74e1-482b-9910-a15047f650c4"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web" src="https://cursor.com/open-in-web.svg"></picture></a> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Add Mongoose timestamps to Movie, introduce authenticated GET /movies/last-update returning ISO timestamp, and add frontend element id to show last update. > > - **Backend**: > - **Schema**: Enable `timestamps: true` on `models/Movie` to track `createdAt`/`updatedAt`. > - **API**: Add `GET /movies/last-update` with JWT auth; returns `{ lastUpdated: <ISO> }` derived from `updatedAt`/`createdAt`/`_id` timestamp. > - **Frontend**: > - Movies page: add `id="movies-last-updated"` element to display last update time. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0d35a19cc51cb7943d1e0bd2c35cb65125e93f8e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
cursor[bot] commented 2025-12-20 16:30:16 -05:00 (Migrated from github.com)

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Cursor Agent can help with this pull request. Just `@cursor` in comments and I'll start working on changes in this branch. <sub>[Learn more](https://cursor.com/docs/background-agent/web-and-mobile) about Cursor Agents</sub>
cursor[bot] (Migrated from github.com) reviewed 2025-12-20 16:34:48 -05:00
cursor[bot] (Migrated from github.com) left a comment

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

### This PR is being reviewed by Cursor Bugbot <details> <summary>Details</summary> You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle. To receive Bugbot reviews on all of your PRs, visit the [Cursor dashboard](https://www.cursor.com/dashboard?tab=bugbot) to activate Pro and start your 14-day free trial. </details>
@@ -100,3 +100,3 @@
<div class="alert alert-warning fade show" role="alert">
Dernière mise à jour des films: <strong>—</strong>
Dernière mise à jour des films: <strong id="movies-last-updated">—</strong>
</div>
cursor[bot] (Migrated from github.com) commented 2025-12-20 16:34:48 -05:00

Missing frontend code to display last update timestamp

The #movies-last-updated HTML element is added and the /last-update API endpoint is implemented, but there's no JavaScript code in app_movies.js to fetch from the endpoint and update the DOM element. Users will always see "—" instead of the actual last update timestamp, making this feature non-functional.

Additional Locations (1)

Fix in Cursor Fix in Web

### Missing frontend code to display last update timestamp <!-- **Medium Severity** --> <!-- DESCRIPTION START --> The `#movies-last-updated` HTML element is added and the `/last-update` API endpoint is implemented, but there's no JavaScript code in `app_movies.js` to fetch from the endpoint and update the DOM element. Users will always see "—" instead of the actual last update timestamp, making this feature non-functional. <!-- DESCRIPTION END --> <!-- LOCATIONS START public/movies.html#L100-L101 routes/movies.js#L41-L66 LOCATIONS END --> <details> <summary>Additional Locations (1)</summary> - [`routes/movies.js#L41-L66`](https://github.com/quoije/oscars-pool/blob/0d35a19cc51cb7943d1e0bd2c35cb65125e93f8e/routes/movies.js#L41-L66) </details> <a href="https://cursor.com/open?data=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImJ1Z2JvdC12MiJ9.eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFiZTZjYjNjLTM2NmItNGY5NC04OGU5LTllMThkODU0NDQ3ZCIsImVuY3J5cHRpb25LZXkiOiJEclRja1ZiSVc5a2lETjhZN2JkNC1HWWlhZGU0Z0I1S2RYNHVOTk9yUmdNIiwiYnJhbmNoIjoiY3Vyc29yL21vdmllLWxhc3QtdXBkYXRlLXRpbWUtNjQ2MSJ9LCJpYXQiOjE3NjYyNjY0ODgsImV4cCI6MTc2ODg1ODQ4OH0.VCigOSl0VVsRlJ3PuJABowRj5EzfGOw3Gixr3gbQEulSDn0rNFIkXMzflyZgiDERnvNfK8txCNbpaUq471JAzZT7LS3dof8ZfsYqWxkROy4-gyydtqXiz5hpFLPhi9WMu6aanIVavxPHuF_-wtwxjVn_PKALIvqQgd9yumH3ZN5IpYx8o7F0IsO_kWWQoBh5Mr8uF1x6lD9u_duPzobyIGyyUXUeqSqBr1y9G_4-DWjhgS1t5HLZlubuduvJpKBQBlTufiIAVmYWQsHq1KwnUAFvirGHUmP1FEJkLG7eSKZp61l5GGmd1G8Dg-VheHYLpWut3-E1tW2m3sdDfgCbQw" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/fix-in-cursor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/fix-in-cursor-light.svg"><img alt="Fix in Cursor" src="https://cursor.com/fix-in-cursor.svg"></picture></a>&nbsp;<a href="https://cursor.com/agents?data=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImJ1Z2JvdC12MiJ9.eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFiZTZjYjNjLTM2NmItNGY5NC04OGU5LTllMThkODU0NDQ3ZCIsImVuY3J5cHRpb25LZXkiOiJEclRja1ZiSVc5a2lETjhZN2JkNC1HWWlhZGU0Z0I1S2RYNHVOTk9yUmdNIiwiYnJhbmNoIjoiY3Vyc29yL21vdmllLWxhc3QtdXBkYXRlLXRpbWUtNjQ2MSIsInJlcG9Pd25lciI6InF1b2lqZSIsInJlcG9OYW1lIjoib3NjYXJzLXBvb2wiLCJwck51bWJlciI6MiwiY29tbWl0U2hhIjoiMGQzNWExOWNjNTFjYjc5NDNkMWUwYmQyYzM1Y2I2NTEyNWU5M2Y4ZSIsInByb3ZpZGVyIjoiZ2l0aHViIn0sImlhdCI6MTc2NjI2NjQ4OCwiZXhwIjoxNzY4ODU4NDg4fQ.Qr4tU8ozI1z0CKvXHKWwXs-MmIZ_3bxnF75aJSEkrsqLoIFy2jgJJh2Z11JZsI76r2qQBO31-YAvmDWhiMOQuJtOFwouJ41tGD1k8giY2tYzPcvGzxP-HtwMS3gwKcs6VFPT3f2_d7TaZeqJNT5ozVaGHNtyZRJoK4Jo9upigBMj1E4xJqv-1jguuyjUbCiRtqe_wvBjf0BTGE_nXuDKKdIWcPhcLyY1tCpeBLvnZw2C08dXZpeqBMlrGpPAB76yfiqoHfZvQoW4DozsDEudkzo3ahSoN_CiBLVApUXATp-pNLGU8Lz8wLWmC9Bei33NvDhayTciQYX5ESbKxBku6w" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/fix-in-web-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/fix-in-web-light.svg"><img alt="Fix in Web" src="https://cursor.com/fix-in-web.svg"></picture></a>
Sign in to join this conversation.