String id = getParam("id");
if (util.isNullOrEmpty(id)) {
throw new IllegalArgumentException("Missing required param: id");
}
Assignment assignment = assignmentDao.getAssignmentById(id);
String status = getParam("status");
if (!util.isNullOrEmpty(status)) {
assignment.setStatus(AssignmentStatus.valueOf(status.toUpperCase()));
}
String description = getParam("description");
if (!util.isNullOrEmpty(description)) {
assignment.setDescription(description);
}
String title = getParam("title");
if (!util.isNullOrEmpty(title)) {
assignment.setTitle(title);
}
String category = getParam("category");
if (!util.isNullOrEmpty(category)) {
assignment.setCategory(category);
}
String playlistId = getParam("playlistId");
if (!util.isNullOrEmpty(playlistId)) {
assignment.setPlaylistId(playlistId);
}
String approvedAlbumUrl = getParam("approvedAlbumUrl");
if (!util.isNullOrEmpty(approvedAlbumUrl)) {
assignment.setApprovedAlbumUrl(approvedAlbumUrl);
}
String rejectedAlbumUrl = getParam("rejectedAlbumUrl");
if (!util.isNullOrEmpty(rejectedAlbumUrl)) {
assignment.setRejectedAlbumUrl(rejectedAlbumUrl);
}
String unreviewedAlbumUrl = getParam("unreviewedAlbumUrl");
if (!util.isNullOrEmpty(unreviewedAlbumUrl)) {
assignment.setUnreviewedAlbumUrl(unreviewedAlbumUrl);
}
assignment = assignmentDao.save(assignment);
return json;