Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add activitiesForProjectActivity endpoint #922

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ out
/grails-app/assets/vendor/
/node_modules/
/grails-app/assets/dist/
~/data/ecodata
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
id 'jacoco'
}

version "4.4-SNAPSHOT"
version "4.5-SNAPSHOT"
group "au.org.ala"
description "Ecodata"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,24 @@ class ActivityController {
}
}

/**
* Returns a detailed list of all activities associated with a project activity
*
* @param id of the project activity
*/
def activitiesForProjectActivity(String id) {
if (id) {
def activityList = []

activityList.addAll activityService.findAllForProjectActivityId(id, "all")

asJson([list: activityList])
} else {
response.status = 404
render status:404, text: 'No such id'
}
}

def listForUser(String id){

def sort = params.sort ?: "lastUpdated"
Expand Down
6 changes: 6 additions & 0 deletions grails-app/controllers/au/org/ala/ecodata/UrlMappings.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class UrlMappings {
controller = 'activity'
action = 'activitiesForProject'
}

"/ws/activitiesForProjectActivity/$id" {
controller = 'activity'
action = 'activitiesForProjectActivity'
}

"/ws/deleteByProjectActivity/$id" {
controller = 'activity'
action = 'deleteByProjectActivity'
Expand Down
Loading