Skip to content

Commit

Permalink
api: handle last page for notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Feb 24, 2016
1 parent 3eaae47 commit 96e96d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/v1/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ func NotificationFromDatabaseModel(dbNotification database.VulnerabilityNotifica
*oldVuln = VulnerabilityWithLayersFromDatabaseModel(*dbNotification.OldVulnerability)
}

var nextPageStr string
if nextPage != database.NoVulnerabilityNotificationPage {
nextPageStr = DBPageNumberToString(nextPage)
}

// TODO(jzelinskie): implement "changed" key
return Notification{
Name: dbNotification.Name,
Expand All @@ -180,7 +185,7 @@ func NotificationFromDatabaseModel(dbNotification database.VulnerabilityNotifica
Deleted: fmt.Sprintf("%d", dbNotification.Deleted.Unix()),
Limit: limit,
Page: DBPageNumberToString(page),
NextPage: DBPageNumberToString(nextPage),
NextPage: nextPageStr,
Old: oldVuln,
New: VulnerabilityWithLayersFromDatabaseModel(dbNotification.NewVulnerability),
}
Expand Down

0 comments on commit 96e96d9

Please sign in to comment.