[PR #4958] [MERGED] refactor: Migrate system preferences to field-based endpoint and remove deprecated endpoint #4843

Closed
opened 2026-02-22 18:36:38 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4958
Author: @angelplusultra
Created: 2/2/2026
Status: Merged
Merged: 2/9/2026
Merged by: @timothycarambat

Base: masterHead: 4957-remove-deprecated-admin-route


📝 Commits (4)

  • 5a969fa Migrate all existing deprecated system preferences endpoint services to new service by field | delete old endpoint and service
  • 6e40c84 format
  • a6b2eb5 destructure settings from response
  • be70b9b nitpick

📊 Changes

7 files changed (+26 additions, -85 deletions)

View changed files

📝 frontend/src/models/admin.js (+0 -14)
📝 frontend/src/pages/Admin/ExperimentalFeatures/index.jsx (+6 -2)
📝 frontend/src/pages/GeneralSettings/EmbeddingTextSplitterPreference/index.jsx (+7 -1)
📝 frontend/src/pages/GeneralSettings/Settings/components/CustomSiteSettings/index.jsx (+4 -1)
📝 frontend/src/pages/GeneralSettings/Settings/components/FooterCustomization/index.jsx (+8 -3)
📝 frontend/src/pages/WorkspaceSettings/AgentConfig/index.jsx (+1 -2)
📝 server/endpoints/admin.js (+0 -62)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4957

What is in this change?

Migrates all frontend usages of the deprecated Admin.systemPreferences() service to the new field-based Admin.systemPreferencesByFields() service, then removes the deprecated endpoint and service.

Changes:

  • EmbeddingTextSplitterPreference - Now requests only text_splitter_chunk_size, text_splitter_chunk_overlap, max_embed_chunk_size
  • CustomSiteSettings - Now requests only meta_page_title, meta_page_favicon
  • FooterCustomization - Now requests only footer_data
  • ExperimentalFeatures - Now requests only feature_flags
  • WorkspaceAgentConfig - Removed unnecessary preferences fetch (wasn't being used)
  • Deleted GET /admin/system-preferences endpoint from server
  • Deleted Admin.systemPreferences() method from frontend

This improves efficiency by only fetching the specific settings each component needs rather than fetching all system preferences.

Additional Information

The new endpoint GET /admin/system-preferences-for?labels=field1,field2 was already in place and working. This PR completes the migration by updating all consumers and removing the deprecated code.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4958 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 2/2/2026 **Status:** ✅ Merged **Merged:** 2/9/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4957-remove-deprecated-admin-route` --- ### 📝 Commits (4) - [`5a969fa`](https://github.com/Mintplex-Labs/anything-llm/commit/5a969fac928eb180c7d652838a1fd0029cce2f29) Migrate all existing deprecated system preferences endpoint services to new service by field | delete old endpoint and service - [`6e40c84`](https://github.com/Mintplex-Labs/anything-llm/commit/6e40c84e279934c641d67c0bc0524a9afd2dd621) format - [`a6b2eb5`](https://github.com/Mintplex-Labs/anything-llm/commit/a6b2eb520acb53b2fdf99135e63910c0087dc795) destructure settings from response - [`be70b9b`](https://github.com/Mintplex-Labs/anything-llm/commit/be70b9b973138b4ddf18effb739ee2cb411543be) nitpick ### 📊 Changes **7 files changed** (+26 additions, -85 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/models/admin.js` (+0 -14) 📝 `frontend/src/pages/Admin/ExperimentalFeatures/index.jsx` (+6 -2) 📝 `frontend/src/pages/GeneralSettings/EmbeddingTextSplitterPreference/index.jsx` (+7 -1) 📝 `frontend/src/pages/GeneralSettings/Settings/components/CustomSiteSettings/index.jsx` (+4 -1) 📝 `frontend/src/pages/GeneralSettings/Settings/components/FooterCustomization/index.jsx` (+8 -3) 📝 `frontend/src/pages/WorkspaceSettings/AgentConfig/index.jsx` (+1 -2) 📝 `server/endpoints/admin.js` (+0 -62) </details> ### 📄 Description ### Pull Request Type - [ ] ✨ feat - [ ] 🐛 fix - [x] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues resolves #4957 ### What is in this change? Migrates all frontend usages of the deprecated `Admin.systemPreferences()` service to the new field-based `Admin.systemPreferencesByFields()` service, then removes the deprecated endpoint and service. **Changes:** - **EmbeddingTextSplitterPreference** - Now requests only `text_splitter_chunk_size`, `text_splitter_chunk_overlap`, `max_embed_chunk_size` - **CustomSiteSettings** - Now requests only `meta_page_title`, `meta_page_favicon` - **FooterCustomization** - Now requests only `footer_data` - **ExperimentalFeatures** - Now requests only `feature_flags` - **WorkspaceAgentConfig** - Removed unnecessary preferences fetch (wasn't being used) - **Deleted** `GET /admin/system-preferences` endpoint from server - **Deleted** `Admin.systemPreferences()` method from frontend This improves efficiency by only fetching the specific settings each component needs rather than fetching all system preferences. ### Additional Information The new endpoint `GET /admin/system-preferences-for?labels=field1,field2` was already in place and working. This PR completes the migration by updating all consumers and removing the deprecated code. ### Developer Validations - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:38 -05:00
yindo closed this issue 2026-02-22 18:36:38 -05:00
yindo changed title from [PR #4958] refactor: Migrate system preferences to field-based endpoint and remove deprecated endpoint to [PR #4958] [MERGED] refactor: Migrate system preferences to field-based endpoint and remove deprecated endpoint 2026-06-05 15:20:39 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4843