BertoCruz / Travel-Tracker

0 stars 0 forks source link

FETCH EndPoints to Keep in Mind #9

Open BertoCruz opened 2 years ago

BertoCruz commented 2 years ago
Description URL Method Required Properties for Request Sample Successful Response
Get all travelers http://localhost:3001/api/v1/travelers GET none object with travelers property containing an array of all travelers
Get single traveler http://localhost:3001/api/v1/travelers/ where will be a number of a traveler’s id GET none object of single traveler’s info
Get all trips http://localhost:3001/api/v1/trips GET none object with trips property containing an array of all trips
Get all destinations http://localhost:3001/api/v1/destinations GET none object with destinations property containing an array of all destinations
Add new trip http://localhost:3001/api/v1/trips POST {id: , userID: , destinationID: , travelers: , date: <string 'YYYY/MM/DD'>, duration: , status: <string 'approved' or 'pending'>, suggestedActivities: } {message: 'Trip with id successfully posted', newTrip: }
Add new destination http://localhost:3001/api/v1/destinations POST {id: , destination: , estimatedLodgingCostPerDay: , estimatedFlightCostPerPerson: , image: , alt: } {message: 'Destination with id successfully posted', newDestination: }
Modify single trip http://localhost:3001/api/v1/updateTrip POST {id: , status:<String of 'approved' or 'pending', suggestedActivities: } Only a status or a suggestedActivities property is required for a successful request {message: 'Trip # has been modified', updatedTrip: }
Delete single trip http://localhost:3001/api/v1/trips/ where will be a number of a trip’s id DELETE none Trip # has been deleted
BertoCruz commented 2 years ago

Note