Skip to content

Fixed alias-related type error in admin API routes#27091

Merged
EvanHahn merged 1 commit intomainfrom
fix-type-error-in-api-routes
Apr 2, 2026
Merged

Fixed alias-related type error in admin API routes#27091
EvanHahn merged 1 commit intomainfrom
fix-type-error-in-api-routes

Conversation

@EvanHahn
Copy link
Copy Markdown
Contributor

@EvanHahn EvanHahn commented Apr 2, 2026

no ref

We effectively had code like this:

router.del = router.delete;

// ...

router.del('/route', handler);

This causes type errors and will make our future TypeScript migration
slightly harder. Let's just use router.delete.

no ref

We effectively had code like this:

```js
router.del = router.delete;

// ...

router.del('/route', handler);
```

This causes type errors and will make our future TypeScript migration
slightly harder. Let's just use `router.delete`.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9aebeef9-c67d-45c9-9382-51687a5eef87

📥 Commits

Reviewing files that changed from the base of the PR and between 1f5d4cc and 46717c2.

📒 Files selected for processing (1)
  • ghost/core/core/server/web/api/endpoints/admin/routes.js

Walkthrough

The admin routes file was updated to remove the custom router.del alias assignment and replace all router.del(...) calls with the standard router.delete(...) method. This refactoring affected route registrations across multiple endpoint categories including posts, pages, integrations, users, tags, members, labels, themes, notifications, webhooks, snippets, and recommendations. All middleware and handler logic bound to these routes remained unchanged; only the method invocation used to register the HTTP DELETE routes was updated.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fixed alias-related type error in admin API routes' directly and clearly summarizes the main change: removing a router.del alias that caused type errors.
Description check ✅ Passed The description is directly related to the changeset, explaining the problem (router.del alias causing type errors) and the solution (use router.delete instead).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-type-error-in-api-routes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EvanHahn EvanHahn enabled auto-merge (squash) April 2, 2026 21:15
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

@EvanHahn EvanHahn merged commit 16745a9 into main Apr 2, 2026
40 checks passed
@EvanHahn EvanHahn deleted the fix-type-error-in-api-routes branch April 2, 2026 21: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.

1 participant