1.1.0 • Published 4 years ago

@x8a/mongo-test v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

ROUTES

MethodURLDescription
GET/loginredirects to / if user logged in. Renders auth/login
POST/loginredirects to /user-profile if user logged in
body:
    - username
    - password
MethodURLDescription
GET/signupRenders auth/signup
POST/signupRedirects to /user-profile
body:
    - name
    - last name
    - username
    - email
    - password
MethodURLDescription
GET/user-profilerenders user profile. If the user is not logged in, render homepage.
GET/edit/user-profile/Idrenders user profile edit page. If the user is not logged in, render homepage.
POST/edit/user-profile/Idupdate user profile. Redirect /user-profile
POST/logoutredirects to /
body:
    - pic
    - name
    - last name
    - username
    - email
    - password
    - pets
MethodURLDescription
GET/petsrenders user's pets
GET/pet-profile/Idrenders pet profile page
GET/edit/pet-profile/Idrenders pet profile edit page
POST/edit/pet-profile/Idupdate pet profile. Redirect /pet-profile:Id
POST/petDelete/Iddelete a pet profile. Redirect to /user-profile
POST/logoutredirects to /
body:
    - pic
    - name
    - type
    - breed
    - birth date
    - age
    - comments
MethodURLDescription
GET/appointmentrenders user's appointments
GET/appointment/Idrenders appointment page
GET/edit/appointment/Idrenders pet profile edit page
POST/edit/appointment/Idupdate appointment. Redirect /user-profile
GET/create/appointmentrenders appointment create page
POST/create/appointmentsaves appointment. Redirect /user-profile
POST/logoutredirects to /
body:
    - title
    - pet
    - vet's name
    - date
    - time
    - comments

Models

  1. This is the 1st element of the list
  2. This is the 2nd element of the list
    User model
    - username: String, required
    - first name: String, required
    - last name: String, required
    - password: String, required
    - image: String
    - pets: Array ObjectID
  3. This is the 3rd element of the list
  4. This is the 4th element of the list
    Pet model
    - name: String, required
    - owner: ObjectID
    - type: String, required
    - breed: String, required
    - comments: String
    - birth date: Date, required
    - appointments: Array ObjectID
  5. This is the 5th element of the list
    Appointment model
    - title: String, required
    - vet: String, required
    - pet: ObjectID, required
    - date: Date, required
    - time: Date, required
    - comments: String