Class: CampgroundController

lib/controllers/campground-controller~CampgroundController()

new CampgroundController()

Create a CampgroundController.
Source:

Methods

(async, static) campgroundCreatePost(req, res)

Create a new Campground resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) campgroundDestroyDelete(req, res)

Remove the specified Campground resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) campgroundEditGet(req, res)

Show to the form for editing the specified Campground resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) campgroundIndexGet(req, res)

Display a listing of the Campground resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) campgroundLikePost(req, res)

Like/dislike a Campground resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(static) campgroundNewGet(req, res)

Show the form for creating a new Campground resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) campgroundShowGet(req, res)

Display the specified Campground resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) campgroundUpdatePut(req, res)

Update the specified Campground resource.
Parameters:
Name Type Description
req Request The HTTP request.
res Response The HTTP response object .
Source:

(async, static) createNewCampgroundNotifications(loggedInUser, campground)

Create notifications of a newly created campground for all followers of the campground author.
Parameters:
Name Type Description
loggedInUser module:lib/models/user The logged in user.
campground module:lib/models/campground The modified campground.
Source:

(static) escapeRegex()

Replaces characters of a search query.
Source:

(async, static) setCampgroundLocData(campground) → {module:lib/models/campground}

Set the geographic coordinates of a campground.
Parameters:
Name Type Description
campground module:lib/models/campground The Campground object.
Source:
Returns:
The modified campground.
Type
module:lib/models/campground

(async, static) uploadCampgroundImage(req) → {module:lib/models/campground}

Upload Campground image to Cloudinary, and add image link to campground object.
Parameters:
Name Type Description
req Request The HTTP Request.
Source:
Returns:
The modified campground.
Type
module:lib/models/campground