Mintplex-Labs / anything-llm

The all-in-one Desktop & Docker AI application with full RAG and AI Agent capabilities.
https://useanything.com
MIT License
15.35k stars 1.6k forks source link

Add API endpoint for updating pin status #1449

Closed yond1994 closed 1 week ago

yond1994 commented 2 weeks ago

Pull Request Type

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:

  1. 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.
  2. 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.
  3. Documentation:

    • Added the new endpoint to openapi.json for easy reference in Swagger UI at http://localhost:3001/api-docs.

    These changes enhance document management by allowing users to efficiently update pin statuses via the API.

Developer Validations

timothycarambat commented 1 week ago

@yond1994 LMK what your discord handle is or ping me in Discord directly if you are in there and I can give the contributor badge in there as wel

yond1994 commented 1 week ago

@timothycarambat Thank you very much, if I am in the discord my user is heavydeveloper