Git Product home page Git Product logo

backend-skilvul-finalproject's Introduction

API Spec

1. Blogs Collection

Field Name Type Description
_id ObjectId Article ID is auto generate by MongoDB when admin add article
title string The article title
img string Image of an article
desc string Short description about the article
content string Main content of the article
author string Admin name who post the article
likes array List of the user_id who likes the article
createdAt date Article created date is auto generated by MongoDB when user add data
updatedAt date Article updated date is auto generated by MongoDB when user update data

a. Create Article

This route is connected to Article collection of MongoDB. Only user with admin role can add the article.

Request :

  • Method : POST
  • Endpoint : /article
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "title": "string",
  "img": "string",
  "desc": "string",
  "content": "string",
  "author": "string"
}

Response :

{
  "message": "Article added successfully",
  "data": {
    "_id": "ObjectId",
    "title": "string",
    "img": "string",
    "desc": "string",
    "content": "string",
    "author": "string",
    "likes": "array",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

b. Read All Article

This route is connected to Article collection of MongoDB. User with admin and member role can read the article.

Request :

  • Method : GET
  • Endpoint : /article
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "title": "string",
  "img": "string",
  "desc": "string",
  "content": "string",
  "author": "string",
  "likes": "array",
  "createdAt": "Date",
  "updatedAt": "Date"
}

c. Read Article by ID

This route is connected to Article collection of MongoDB. User with admin and member role can read the article by id.

Request :

  • Method : GET
  • Endpoint : /article/:id
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "title": "string",
  "img": "string",
  "desc": "string",
  "content": "string",
  "author": "string",
  "likes": "array",
  "createdAt": "Date",
  "updatedAt": "Date"
}

d. Update Article

This route is connected to Article collection of MongoDB. Only user with admin role can update the article by id.

Request :

  • Method : PATCH
  • Endpoint : /article/:id
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "title": "string",
  "img": "string",
  "desc": "string",
  "content": "string",
  "author": "string"
}

Response :

{
  "message": "Article updated successfully",
  "data": {
    "_id": "ObjectId",
    "title": "string",
    "img": "string",
    "desc": "string",
    "content": "string",
    "author": "string",
    "likes": "array",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

e. Delete Article

This route is connected to Article collection of MongoDB. Only with admin role can delete the article by id.

Request :

  • Method : DELETE
  • Endpoint : /article/:id
  • Header :
    • Accept: application/json

Response :

{
  "message": "Article deleted"
}

2. Psychologist Profile Collection

Field Name Type Description
_id int Psychologist ID is auto generate by MongoDB when admin add Psychologist profile
name string Name of the psychologist
img string Photo profile of the psychologist
profile string The introduction about psychologist background and experience
expertise array List of psychologist expertise area
rating double User rating of the psychologist
createdAt date Psychologist created date is auto generated by MongoDB when user add data
updatedAt date Psychologist updated date is auto generated by MongoDB when user update

a. Create Psychologist Profile

This route is connected to Psychologist Profile collection of MongoDB. Only user with admin role can add the psychologist profile.

Request :

  • Method : POST
  • Endpoint : /psikolog
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "name": "string",
  "img": "string",
  "expert role": "string",
  "profile": "string",
  "expertise": "string",
  "rating": "double"
}

Response :

{
  "message": "Psychologist profile updated successfully",
  "data": {
    "_id": "ObjectId",
    "name": "string",
    "img": "string",
    "profile": "string",
    "expertise": "string",
    "rating": "double",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

b. Read All Psychologist Profile

This route is connected to Psychologist Profile collection of MongoDB. User with admin and member role can read the psychologist profile.

Request :

  • Method : GET
  • Endpoint : /psikolog
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "name": "string",
  "img": "string",
  "profile": "string",
  "expertise": "string",
  "rating": "double",
  "createdAt": "Date",
  "updatedAt": "Date"
}

c. Read Psychologist Profile by Id

This route is connected to Psychologist Profile collection of MongoDB. User with admin and member role can read the psychologist profile by id.

Request :

  • Method : GET
  • Endpoint : /psikolog/:id
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "name": "string",
  "img": "string",
  "profile": "string",
  "expertise": "string",
  "rating": "double",
  "createdAt": "Date",
  "updatedAt": "Date"
}

d. Update Psychologist Profile

This route is connected to Psychologist Profile collection of MongoDB. User with admin role can update the psychologist profile by id.

Request :

  • Method : PATCH
  • Endpoint : /psikolog/:id
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "name": "string",
  "img": "string",
  "expert role": "string",
  "profile": "string",
  "expertise": "string",
  "rating": "double"
}

Response :

{
  "message": "Psychologist profile updated successfully",
  "data": {
    "_id": "ObjectId",
    "name": "string",
    "img": "string",
    "profile": "string",
    "expertise": "string",
    "rating": "double",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

e. Delete Psychologist Profile

This route is connected to Psychologist Profile collection of MongoDB. User with admin and member role can read the psychologist profile by id.

Request :

  • Method : DELETE
  • Endpoint : /psikolog/:id
  • Header :
    • Content-Type: application/json
    • Accept: application/json

Response :

{
  "message": "Psychologist profile deleted"
}

3. Users Profile Collection

Field Name Type Description
_id int User ID is auto generate by MongoDB when admin add profile
name string User full name
email string User email
password string User password
role string User role either member or admin
createdAt date User created date is auto generated by MongoDB when user register
updatedAt date User updated date is auto generated by MongoDB when user update

a. Create User Profile

This route is connected to Users Profile collection of MongoDB. User will create this profile when he registering via register page

Request :

  • Method : POST
  • Endpoint : /user
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "name": "string",
  "email": "string",
  "password": "string",
  "role": "string"
}

Response :

{
  "message": "User created successfully",
  "data": {
    "id": "ObjectId",
    "name": "string",
    "email": "string",
    "password": "string",
    "role": "string",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

b. Read All User Profile

This route is connected to Users Profile collection of MongoDB. Only admin role can access the information of all user

Request :

  • Method : GET
  • Endpoint : /user
  • Header :
    • Accept: application/json

Response :

{
  "id": "ObjectId",
  "name": "string",
  "email": "string",
  "role": "string",
  "createdAt": "Date",
  "updatedAt": "Date"
}

c. Read User Profile by Id

This route is connected to Users Profile collection of MongoDB. User who registered can see his information by visiting user page

Request :

  • Method : GET
  • Endpoint : /user/:id
  • Header :
    • Accept: application/json

Response :

{
  "id": "ObjectId",
  "name": "string",
  "email": "string",
  "password": "string",
  "role": "string",
  "createdAt": "Date",
  "updatedAt": "Date"
}

d. Update User's profile

This route is connected to Users Profile collection of MongoDB. User who registered can update his profile through visiting user page and click on edit profile

Request :

  • Method : PATCH
  • Endpoint : /user/id
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "name": "string",
  "password": "string"
}

Response :

{
  "message": "User profile updated successfully"
}

e. Delete User's profile

This route is connected to Users Profile collection of MongoDB. Admin and member role can deleted the user profile

Request :

  • Method : DELETE
  • Endpoint : /user
  • Header :
    • Accept: application/json

Response :

{
  "message": "User deleted"
}

4. Webinar Collection

Field Name Type Description
_id int Webinar ID is auto generate by MongoDB when admin add profile
title string Webinar title
thumbnail string Webinar image thumbnail
desc string Description about webinar topic
url string Url of webinar video
likes array List of the user_id who likes the webinar
createdAt date Webinar created date is auto generated by MongoDB when user register
updatedAt date Webinar updated date is auto generated by MongoDB when user update

a. Create Webinar

This route is connected to Webinar collection of MongoDB. Only admin role can add webinar video via dashboard

Request :

  • Method : POST
  • Endpoint : /webinars
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "title": "string",
  "thumbnail": "string",
  "desc": "string",
  "url": "string"
}

Response :

{
  "message": "Webinar added successfully",
  "data": {
    "_id": "ObjectId",
    "title": "string",
    "thumbnail": "string",
    "desc": "string",
    "url": "string",
    "create_date": "date",
    "likes": "array",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

b. Read All Webinar

This route is connected to Webinar collection of MongoDB. Admin and member role can view the webinar video by visiting webinar page

Request :

  • Method : GET
  • Endpoint : /webinars
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "title": "string",
  "thumbnail": "string",
  "desc": "string",
  "url": "string",
  "create_date": "date",
  "likes": "array",
  "createdAt": "Date",
  "updatedAt": "Date"
}

c. Read Webinar by Id

This route is connected to Webinar collection of MongoDB. Admin and member role can view the webinar video by visiting webinar page

Request :

  • Method : GET
  • Endpoint : /webinars/:id
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "title": "string",
  "thumbnail": "string",
  "desc": "string",
  "url": "string",
  "create_date": "date",
  "likes": "array",
  "createdAt": "Date",
  "updatedAt": "Date"
}

d. Update Webinar profile

This route is connected to Webinar collection of MongoDB. Only admin role can update the webinar video via dashboard

Request :

  • Method : PATCH
  • Endpoint : /webinars/:id
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "name": "string",
  "email": "string",
  "password": "string",
  "role": "string",
  "create_date": "date"
}

Response :

{
  "message": "Webinar updated successfully",
  "data": {
    "_id": "ObjectId",
    "title": "string",
    "thumbnail": "string",
    "desc": "string",
    "url": "string",
    "create_date": "date",
    "likes": "array",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

e. Delete User's profile

This route is connected to Webinar collection of MongoDB. Only admin role can delete the webinar video via dashboard

Request :

  • Method : DELETE
  • Endpoint : /webinars/:id
  • Header :
    • Accept: application/json

Response :

{
  "message": "Webinar deleted"
}

5. Register

This route is connected to Register of MongoDB. Only member role can join the website

  • Endpoint : /register

Request :

{
  "name": "string",
  "email": "string",
  "password": "string"
}

Response :

{
  "message": "user created"
}

6. Login

This route is connected to Login of MongoDB. Only member role can join the website

  • Endpoint : /login

Request :

{
  "email": "string",
  "password": "string"
}

Response :

{
  "accessToken": "string"
}

7. Coaching Collection

Field Name Type Description
_id int Coaching ID is auto generate by MongoDB when admin add profile
materials string coaching materials
content string Main content about coaching topic
coach string coach who attending coaching
categories string category about coaching topic

a. Create Coaching

This route is connected to coaching collection of MongoDB. Only admin role can add coaching video via dashboard

Request :

  • Method : POST
  • Endpoint : /coaching
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "materials": "string",
  "content": "string",
  "coach": "string",
  "categories": "array"
}

Response :

{
  "message": "coaching added successfully",
  "data": {
    "_id": "ObjectId",
    "materials": "string",
    "content": "string",
    "coach": "string",
    "categories": "array",
    "create_date": "date",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

b. Read All coaching

This route is connected to coaching collection of MongoDB. Admin and member role can view the coaching video by visiting coaching page

Request :

  • Method : GET
  • Endpoint : /coaching
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "materials": "string",
  "content": "string",
  "coach": "string",
  "categories": "array",
  "create_date": "date",
  "createdAt": "Date",
  "updatedAt": "Date"
}

c. Read Coaching by Id

This route is connected to coaching collection of MongoDB. Admin and member role can view the coaching video by visiting coaching page

Request :

  • Method : GET
  • Endpoint : /coaching/:id
  • Header :
    • Accept: application/json

Response :

{{
  "_id": "ObjectId",
  "materials": "string",
  "content": "string",
  "coach": "string",
  "categories": "array",
  "create_date": "date",
  "createdAt": "Date",
  "updatedAt": "Date"
}

d. Update coaching profile

This route is connected to coaching collection of MongoDB. Only admin role can update the coaching via dashboard

Request :

  • Method : PATCH
  • Endpoint : /coaching/:id
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "materials": "string",
  "content": "string",
  "coach": "string",
  "categories": "array"
}

Response :

{
  "message": "coaching updated successfully",
  "data": {
    {
      "_id": "ObjectId",
      "materials": "string",
      "content": "string",
      "coach": "string",
      "categories": "array",
      "create_date": "date",
      "createdAt": "Date",
      "updatedAt": "Date"
    }
  }
}

**e. Delete coaching

This route is connected to coaching collection of MongoDB. Only admin role can delete the coaching via dashboard

Request :

  • Method : DELETE
  • Endpoint : /coaching/:id
  • Header :
    • Accept: application/json

Response :

{
  "message": "coaching deleted"
}

8. Dyslexia Collection

Field Name Type Description
_id int dyslexia ID is auto generate by MongoDB when admin add profile
name string dyslexia's name
price integer dyslexia's price packet
benefit string benefit of dyslexia

a. Create Dyslexia

This route is connected to dyslexia collection of MongoDB. Only admin role can add dyslexia video via dashboard

Request :

  • Method : POST
  • Endpoint : /dyslexia
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "name": "string",
  "price": "integer",
  "benefit": "string"
}

Response :

{
  "message": "dyslexia added successfully",
  "data": {
    "_id": "ObjectId",
    "name": "string",
    "price": "integer",
    "benefit": "string",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

b. Read All dyslexia

This route is connected to dyslexia collection of MongoDB. Admin and member role can view the dyslexia video by visiting dyslexia page

Request :

  • Method : GET
  • Endpoint : /dyslexia
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "_id": "ObjectId",
  "name": "string",
  "price": "integer",
  "benefit": "string",
  "createdAt": "Date",
  "updatedAt": "Date"
}

c. Read dyslexia by Id

This route is connected to dyslexia collection of MongoDB. Admin and member role can view the dyslexia video by visiting dyslexia page

Request :

  • Method : GET
  • Endpoint : /dyslexia/:id
  • Header :
    • Accept: application/json

Response :

{{
  "_id": "ObjectId",
  "name": "string",
  "price": "integer",
  "benefit": "string",
  "createdAt": "Date",
  "updatedAt": "Date"
}

d. Update dyslexia profile

This route is connected to dyslexia collection of MongoDB. Only admin role can update the dyslexia via dashboard

Request :

  • Method : PATCH
  • Endpoint : /dyslexia/:id
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "name": "string",
  "price": "integer",
  "benefit": "string"
}

Response :

{
  "message": "dyslexia updated successfully",
  "data": {
    {
      "_id": "ObjectId",
      "name": "string",
      "price": "integer",
      "benefit": "string",
      "createdAt": "Date",
      "updatedAt": "Date"
    }
  }
}

e. Delete dyslexia

This route is connected to dyslexia collection of MongoDB. Only admin role can delete the dyslexia via dashboard

Request :

  • Method : DELETE
  • Endpoint : /dyslexia/:id
  • Header :
    • Accept: application/json

Response :

{
  "message": "dyslexia deleted"
}

9. Health-test Collection

Field Name Type Description
_id int Health-test ID is auto generate by MongoDB when admin add profile
question string Health-test's question
answer array Health-test's answer

a. Create health-test

This route is connected to health-test collection of MongoDB. Only admin role can add health-test via dashboard

Request :

  • Method : POST
  • Endpoint : /health-test
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "question": "string",
  "answer": "array"
}

Response :

{
  "message": "Health-test added successfully",
  "data": {
    "_id": "ObjectId",
    "question": "string",
    "answer": "array",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

b. Read All Health-test

This route is connected to health-test collection of MongoDB. Admin and member role can view the health-test by visiting health-test page

Request :

  • Method : GET
  • Endpoint : /health-test
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "question": "string",
  "answer": "array",
  "createdAt": "Date",
  "updatedAt": "Date"
}

c. Read Health-test by Id

This route is connected to health-test collection of MongoDB. Admin and member role can view the health-test video by visiting health-test page

Request :

  • Method : GET
  • Endpoint : /health-test/:id
  • Header :
    • Accept: application/json

Response :

{{
  "_id": "ObjectId",
  "question": "string",
  "answer": "array",
  "createdAt": "Date",
  "updatedAt": "Date"
}

d. Update health-test profile

This route is connected to health-test collection of MongoDB. Only admin role can update the health-test via dashboard

Request :

  • Method : PATCH
  • Endpoint : /health-test/:id
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "question": "string",
  "answer": "array"
}

Response :

{
  "message": "Health-test updated successfully",
  "data": {
    {
      "_id": "ObjectId",
      "question": "string",
      "answer": "array",
      "createdAt": "Date",
      "updatedAt": "Date"
    }
  }
}

e. Delete Health-test

This route is connected to health-test collection of MongoDB. Only admin role can delete the health-test via dashboard

Request :

  • Method : DELETE
  • Endpoint : /health-test/:id
  • Header :
    • Accept: application/json

Response :

{
  "message": "Health-test deleted"
}

10. Screening Collection

Field Name Type Description
_id int Screening ID is auto generate by MongoDB when admin add profile
question string Screening's question
answer array Screening's answer

a. Create Screening

This route is connected to screening collection of MongoDB. Only admin role can add screening via dashboard

Request :

  • Method : POST
  • Endpoint : /screening
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "question": "string",
  "answer": "array"
}

Response :

{
  "message": "Screening added successfully",
  "data": {
    "_id": "ObjectId",
    "question": "string",
    "answer": "array",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

b. Read All Screening

This route is connected to screening collection of MongoDB. Admin and member role can view the screening by visiting screening page

Request :

  • Method : GET
  • Endpoint : /screening
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "question": "string",
  "answer": "array",
  "createdAt": "Date",
  "updatedAt": "Date"
}

c. Read Screening by Id

This route is connected to screening collection of MongoDB. Admin and member role can view the screening video by visiting screening page

Request :

  • Method : GET
  • Endpoint : /screening/:id
  • Header :
    • Accept: application/json

Response :

{{
  "_id": "ObjectId",
  "question": "string",
  "answer": "array",
  "createdAt": "Date",
  "updatedAt": "Date"
}

d. Update screening profile

This route is connected to screening collection of MongoDB. Only admin role can update the screening via dashboard

Request :

  • Method : PATCH
  • Endpoint : /screening/:id
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "question": "string",
  "answer": "array"
}

Response :

{
  "message": "screening updated successfully",
  "data": {
    {
      "_id": "ObjectId",
      "question": "string",
      "answer": "array",
      "createdAt": "Date",
      "updatedAt": "Date"
    }
  }
}

e. Delete Screening

This route is connected to screening collection of MongoDB. Only admin role can delete the screening via dashboard

Request :

  • Method : DELETE
  • Endpoint : /screening/:id
  • Header :
    • Accept: application/json

Response :

{
  "message": "screening deleted"
}

11. Paket Collection

Field Name Type Description
_id int paket ID is auto generate by MongoDB when admin add profile
name string paket's name
price integer paket's price packet
benefit string benefit of paket

a. Create Paket

This route is connected to paket collection of MongoDB. Only admin role can add paket video via dashboard

Request :

  • Method : POST
  • Endpoint : /paket
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "name": "string",
  "price": "integer",
  "benefit": "string"
}

Response :

{
  "message": "paket added successfully",
  "data": {
    "_id": "ObjectId",
    "name": "string",
    "price": "integer",
    "benefit": "string",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

b. Read All paket

This route is connected to paket collection of MongoDB. Admin and member role can view the paket video by visiting paket page

Request :

  • Method : GET
  • Endpoint : /paket
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "_id": "ObjectId",
  "name": "string",
  "price": "integer",
  "benefit": "string",
  "createdAt": "Date",
  "updatedAt": "Date"
}

c. Read paket by Id

This route is connected to paket collection of MongoDB. Admin and member role can view the paket video by visiting paket page

Request :

  • Method : GET
  • Endpoint : /paket/:id
  • Header :
    • Accept: application/json

Response :

{{
  "_id": "ObjectId",
  "name": "string",
  "price": "integer",
  "benefit": "string",
  "createdAt": "Date",
  "updatedAt": "Date"
}

d. Update paket profile

This route is connected to paket collection of MongoDB. Only admin role can update the paket via dashboard

Request :

  • Method : PATCH
  • Endpoint : /paket/:id
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "name": "string",
  "price": "integer",
  "benefit": "string"
}

Response :

{
  "message": "paket updated successfully",
  "data": {
    {
      "_id": "ObjectId",
      "name": "string",
      "price": "integer",
      "benefit": "string",
      "createdAt": "Date",
      "updatedAt": "Date"
    }
  }
}

e. Delete paket

This route is connected to paket collection of MongoDB. Only admin role can delete the paket via dashboard

Request :

  • Method : DELETE
  • Endpoint : /paket/:id
  • Header :
    • Accept: application/json

Response :

{
  "message": "paket deleted"
}

12. Consultation Collection

Field Name Type Description
_id int consultation ID is auto generate by MongoDB when admin add profile
user string user's name
psikolog string psikolog's name
consultation_schedule date schedule of consultation
consultation_paket string paket of consultation

a. Create Consultation

This route is connected to consultation collection of MongoDB. Only admin role can add consultation video via dashboard

Request :

  • Method : POST
  • Endpoint : /consultation
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "user": "string",
  "psikolog": "string",
  "consultation_schedule": "date",
  "consultation_paket": "string"
}

Response :

{
  "message": "consultation added successfully",
  "data": {
    "_id": "ObjectId",
    "user": "string",
    "psikolog": "string",
    "consultation_schedule": "date",
    "consultation_paket": "string",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

b. Read All consultation

This route is connected to consultation collection of MongoDB. Admin and member role can view the consultation video by visiting consultation page

Request :

  • Method : GET
  • Endpoint : /consultation
  • Header :
    • Accept: application/json

Response :

{
  "_id": "ObjectId",
  "user": "string",
  "psikolog": "string",
  "consultation_schedule": "date",
  "consultation_paket": "string",
  "createdAt": "Date",
  "updatedAt": "Date"
}

c. Read consultation by Id

This route is connected to consultation collection of MongoDB. Admin and member role can view the consultation video by visiting consultation page

Request :

  • Method : GET
  • Endpoint : /consultation/:id
  • Header :
    • Accept: application/json

Response :

{{
  "_id": "ObjectId",
  "user": "string",
  "psikolog": "string",
  "consultation_schedule": "date",
  "consultation_paket": "string",
  "createdAt": "Date",
  "updatedAt": "Date"
}

d. Update consultation profile

This route is connected to consultation collection of MongoDB. Only admin role can update the consultation via dashboard

Request :

  • Method : PATCH
  • Endpoint : /consultation/:id
  • Header :
    • Content-Type: application/json
    • Accept: application/json
  • Body :
{
  "user": "string",
  "psikolog": "string",
  "consultation_schedule": "date",
  "consultation_paket": "string"
}

Response :

{
  "message": "consultation updated successfully",
  "data": {
    {
      "_id": "ObjectId",
      "user": "string",
      "psikolog": "string",
      "consultation_schedule": "date",
      "consultation_paket": "string",
      "createdAt": "Date",
      "updatedAt": "Date"
    }
  }
}

e. Delete consultation

This route is connected to consultation collection of MongoDB. Only admin role can delete the consultation via dashboard

Request :

  • Method : DELETE
  • Endpoint : /consultation/:id
  • Header :
    • Accept: application/json

Response :

{
  "message": "consultation deleted"
}

backend-skilvul-finalproject's People

Contributors

randyputra45 avatar yeojaxr avatar

Stargazers

 avatar HelloBagus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.