Skip to content

Comments

feat: add routes-f update endpoint with optimistic concurrency#313

Merged
davedumto merged 1 commit intoStreamFi-x:devfrom
Jay-Peter-Egemasi:feat/routes-f-update-endpoint
Feb 24, 2026
Merged

feat: add routes-f update endpoint with optimistic concurrency#313
davedumto merged 1 commit intoStreamFi-x:devfrom
Jay-Peter-Egemasi:feat/routes-f-update-endpoint

Conversation

@Jay-Peter-Egemasi
Copy link
Contributor

Description

Closes #299

Changes proposed

What were you told to do?

Backend: Add routes-f update endpoint with optimistic concurrency (#299)

What did you do?

  • Added optional etag property to the RoutesFRecord interface (lib/routes-f/types.ts).
  • Created getRoutesFRecordById and updateRoutesFRecord methods in the mock store (lib/routes-f/store.ts), managing ETag matching logic and ETag assignments for updates.
  • Added PATCH and GET handlers for /api/routes-f/items/[id] (app/api/routes-f/items/[id]/route.ts). The PATCH endpoint verifies the If-Match header and returns a 428 error if it is missing or 412 if the ETag mismatches.
  • Authored test cases covering these concurrency flows (app/api/routes-f/__tests__/items.test.ts).

Check List (Check all the applicable boxes)

🚨Please review the contribution guideline for this repository.

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the main branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Screenshots/Videos

N/A - This is a purely backend feature with tests validating the requests and responses under the hood.

@vercel
Copy link

vercel bot commented Feb 24, 2026

@Jay-Peter-Egemasi is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@davedumto davedumto merged commit de5789a into StreamFi-x:dev Feb 24, 2026
1 check failed
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.

Backend: Add routes-f update endpoint

2 participants