Skip to content

fix: return 201 Created for all resource creation endpoints#182

Open
jakebromberg wants to merge 5 commits intomainfrom
fix/41-create-status-201
Open

fix: return 201 Created for all resource creation endpoints#182
jakebromberg wants to merge 5 commits intomainfrom
fix/41-create-status-201

Conversation

@jakebromberg
Copy link
Member

@jakebromberg jakebromberg commented Feb 21, 2026

Summary

  • All resource creation endpoints were returning HTTP 200 instead of the correct HTTP 201 Created status code
  • Fixed addEntry (3 success paths) in flowsheet.controller.ts, addToBin in djs.controller.ts, addAlbum/addArtist/addRotation/addFormat/addGenre in library.controller.ts, and addToSchedule in schedule.controller.ts
  • Added unit tests for addToBin and addToSchedule to verify 201 status

Test plan

  • New unit tests verify addToBin and addToSchedule return 201
  • Full unit test suite passes (122 tests)
  • Verify no downstream clients depend on checking for 200 specifically (RTK Query and axios treat 2xx identically)

Closes #41

Copy link
Collaborator

@AyBruno AyBruno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to address remaining .expect(200) in integration tests

Jake Bromberg and others added 4 commits March 9, 2026 22:53
All create endpoints (flowsheet entries, bin entries, albums, artists,
rotation, formats, genres, schedule) returned 200 instead of 201.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ndpoints

The addEntry controller now returns 201 Created instead of 200 OK.
Update all POST /flowsheet assertions in the integration tests accordingly.
Updates remaining .expect(200) to .expect(201) in djs, library, and
schedule integration tests for POST endpoints that create resources.
@jakebromberg jakebromberg force-pushed the fix/41-create-status-201 branch from 1584aac to ef5e804 Compare March 10, 2026 06:29
All 19 POST /flowsheet calls in the metadata integration tests were still expecting 200, but the controller now returns 201 for successful creation. Updated to match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants