OPJU-Developers-Community / opju-exam-portal-fe-admin

Admin Portal - Seamless Access for Administrators
https://uat-opju-admin.netlify.app/
3 stars 2 forks source link

[Doc]: Request for education API #14

Open aniimessh opened 8 months ago

aniimessh commented 8 months ago

Documentation description

Need a post and get API for education management with pagination

subrat611 commented 8 months ago

Here is the required API - POST

BASE_URL = /api/v1/admin

POST {BASE_URL}/create-education

params

type - university | school

payload

{string} program
{string} course
{string} branch
{number} semester
{array{string}} subjects

Example

params

{BASE_URL}/create-education?type=university

Payload

{
    "program": "Engineering",
    "course": "Btech",
    "branch": "Mech",
    "semester": "2",
    "subjects": ["operating system, database management system", "cryptography"],
    "education_type": "university"
}

Response

{
    "success": true,
    "message": "you have successfully created an education."
}
subrat611 commented 8 months ago

Here is the required API - GET

BASE_URL = /api/v1/admin

GET {BASE_URL}/get-education-list

params

{string} type = university | school
{number} page=1
{number} limit=10

Example

params

{BASE_URL}/get-education-list?type=university&page=1&limit=10

Response

{
    "success": true,
    "message": "success",
    "count": 4,
    "data": [
        {
            "_id": "6554c05eeba88d1f561f2e94",
            "program": "Engineering",
            "course": "Btech",
            "branch": "Mech",
            "semester": 2,
            "subjects": [
                "operating system, database management system",
                "cryptography"
            ],
            "education_type": "university",
            "createdAt": "2023-11-15T12:58:06.791Z",
            "updatedAt": "2023-11-15T12:58:06.791Z",
            "__v": 0
        },
        {
            "_id": "6554c05feba88d1f561f2e96",
            "program": "Engineering",
            "course": "Btech",
            "branch": "Mech",
            "semester": 2,
            "subjects": [
                "operating system, database management system",
                "cryptography"
            ],
            "education_type": "university",
            "createdAt": "2023-11-15T12:58:07.292Z",
            "updatedAt": "2023-11-15T12:58:07.292Z",
            "__v": 0
        },
        {
            "_id": "6554c05feba88d1f561f2e98",
            "program": "Engineering",
            "course": "Btech",
            "branch": "Mech",
            "semester": 2,
            "subjects": [
                "operating system, database management system",
                "cryptography"
            ],
            "education_type": "university",
            "createdAt": "2023-11-15T12:58:07.717Z",
            "updatedAt": "2023-11-15T12:58:07.717Z",
            "__v": 0
        },
        {
            "_id": "6554c060eba88d1f561f2e9a",
            "program": "Engineering",
            "course": "Btech",
            "branch": "Mech",
            "semester": 2,
            "subjects": [
                "operating system, database management system",
                "cryptography"
            ],
            "education_type": "university",
            "createdAt": "2023-11-15T12:58:08.181Z",
            "updatedAt": "2023-11-15T12:58:08.181Z",
            "__v": 0
        }
    ]
}