Pull down all non-code notes (#14)
This commit changes the filter on the API response so that we are only filtering out system level notes. This means we get notes that are not linked to specific locations in the code. Subsequent work will have to separate these types of notes from the other code-linked notes and probably display them in some sort of separate tree.
This commit is contained in:
committed by
GitHub
parent
22389fdb3d
commit
f15711edab
@@ -44,18 +44,18 @@ func (c *Client) ListDiscussions() ([]*gitlab.Discussion, int, error) {
|
||||
return nil, res.Response.StatusCode, fmt.Errorf("Listing discussions failed: %w", err)
|
||||
}
|
||||
|
||||
var realDiscussions []*gitlab.Discussion
|
||||
var diffNotes []*gitlab.Discussion
|
||||
for i := 0; i < len(discussions); i++ {
|
||||
notes := discussions[i].Notes
|
||||
for j := 0; j < len(notes); j++ {
|
||||
if notes[j].Type == gitlab.NoteTypeValue("DiffNote") {
|
||||
realDiscussions = append(realDiscussions, discussions[i])
|
||||
if !notes[j].System {
|
||||
diffNotes = append(diffNotes, discussions[i])
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sortedDiscussions := SortableDiscussions(realDiscussions)
|
||||
sortedDiscussions := SortableDiscussions(diffNotes)
|
||||
sort.Sort(sortedDiscussions)
|
||||
|
||||
return sortedDiscussions, http.StatusOK, nil
|
||||
|
||||
Reference in New Issue
Block a user