Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create dashboard for admin to approve or reject components #65

Open
itzamanjain opened this issue Jan 31, 2025 · 0 comments
Open

create dashboard for admin to approve or reject components #65

itzamanjain opened this issue Jan 31, 2025 · 0 comments

Comments

@itzamanjain
Copy link
Contributor

here is api endpoint for the same

Dashboard API - Update Component Status

Endpoint

PATCH ${base_url}api/dashboard?email={ADMIN_EMAIL}&password={ADMIN_PASSWORD}

Update the status of a component by its ID.


Request Query Parameters

  • email (required): Admin email for authorization.
  • password (required): Admin password for authorization.

Request Body

Content-Type: application/json

{
  "id": "string",          // ID of the component to update
  "status": "string"       // New status of the component (e.g., "approved", "rejected")
}

example
{
"id":"679c6f27d4a51160878c47c2",
"status":"reject"

}

example response 
{
    "message": "Status updated",
    "approveComp": {
        "_id": "679c6f27d4a51160878c47c2",
        "code": "<button class='bg-blue-500 text-white p-2 rounded'>Click Me</button>",
        "title": "Primary Button",
        "tags": [
            "button",
            "ui",
            "interactive"
        ],
        "description": "A simple primary button component with rounded corners and blue background.",
        "author": "https://github.com/itzamanjain",
        "status": "reject",
        "installationGuide": "npm install shadcn@latest",
        "usageGuide": "<PrimaryButton>Click Me</PrimaryButton>",
        "props": "{ color: 'blue', size: 'medium' }",
        "__v": 0
    }
}
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

No branches or pull requests

1 participant