new CampgroundController()
Create a CampgroundController.
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 . |
(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 . |
(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 . |
(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 . |
(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 . |
(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 . |
(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 . |
(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 . |
(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. |
(static) escapeRegex()
Replaces characters of a search query.
(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. |
Returns:
The modified 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. |
Returns:
The modified campground.