anything-llm
anything-llm copied to clipboard
Add API endpoint for updating pin status
Pull Request Type
- [x] ✨ feat
- [ ] 🐛 fix
- [ ] ♻️ refactor
- [ ] 💄 style
- [ ] 🔨 chore
- [ ] 📝 docs
Relevant Issues
resolves #1051
What is in this change?
This pull request introduces a new API endpoint to update the pin status of a document within a workspace.
Key Changes:
-
New Endpoint:
-
Path:
/workspace/:slug/update-pin -
Method:
POST - Description: Allows users to add or remove the pin status of a specified document in a workspace.
-
Path:
-
Endpoint Details:
-
Parameters:
-
slug: Unique identifier of the workspace (in path). -
Authorization: Token (in header).
-
-
Request Body:
{ "docPath": "custom-documents/my-pdf.pdf-hash.json", "pinStatus": true } -
Responses:
-
200 OK: Pin status updated successfully. -
404 Not Found: Document not found. -
500 Internal Server Error: Internal server error.
-
-
Parameters:
-
Documentation:
- Added the new endpoint to
openapi.jsonfor easy reference in Swagger UI athttp://localhost:3001/api-docs.
These changes enhance document management by allowing users to efficiently update pin statuses via the API.
- Added the new endpoint to
Developer Validations
- [x] I ran
yarn lintfrom the root of the repo & committed changes - [x] Relevant documentation has been updated
- [x] I have tested my code functionality
- [x] Docker build succeeds locally