Skip to content

Conversation

@ntucker
Copy link
Collaborator

@ntucker ntucker commented Nov 16, 2025

Solution

Add RestEndpoint.remove

Creates a PATCH endpoint that both removes an entity from a Collection and updates the entity with the provided body data.

const getTodos = new RestEndpoint({
  path: '/todos',
  schema: new schema.Collection([Todo]),
});

// Removes Todo from collection AND updates it with new data
await ctrl.fetch(getTodos.remove, {}, { id: '123', title: 'Done', completed: true });
// Remove user from group list and update their group
await ctrl.fetch(
  UserResource.getList.remove,
  { group: 'five' },
  { id: 2, username: 'user2', group: 'newgroup' }
);
// User is removed from the 'five' group list
// AND the user entity is updated with group: 'newgroup'

@changeset-bot
Copy link

changeset-bot bot commented Nov 16, 2025

🦋 Changeset detected

Latest commit: b572aef

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@data-client/rest Patch
test-bundlesize Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ntucker ntucker force-pushed the restendpoint.remove branch from 14b1fc6 to b572aef Compare November 16, 2025 22:35
@codecov
Copy link

codecov bot commented Nov 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.29%. Comparing base (3d808ab) to head (b572aef).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3623   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files         147      147           
  Lines        2579     2581    +2     
  Branches      501      501           
=======================================
+ Hits         2535     2537    +2     
  Misses         10       10           
  Partials       34       34           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntucker ntucker merged commit 8be3b17 into master Nov 16, 2025
23 checks passed
@ntucker ntucker deleted the restendpoint.remove branch November 16, 2025 22:41
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