Skip to content

Commit

Permalink
Merge pull request #858 from NBISweden/hotfix/search-activities
Browse files Browse the repository at this point in the history
fix: Make search also return Project info
  • Loading branch information
kusalananda authored Sep 13, 2023
2 parents 3123a00 + 6bac901 commit 4ef14ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions backend/api/issueSearchHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ func issueSearchHandler(c *fiber.Ctx) error {

searchResponse := struct {
Results []struct {
Id int `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
Id int `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
Project Project `json:"project"`
} `json:"results"`
}{}

Expand Down Expand Up @@ -73,6 +74,7 @@ func issueSearchHandler(c *fiber.Ctx) error {
issue := Issue{
Id: issue.Id,
Subject: issuesResponse.Issues[0].Subject,
Project: issuesResponse.Issues[0].Project,
}
foundIssues = append(foundIssues, issue)
}
Expand Down
9 changes: 7 additions & 2 deletions backend/api/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ type user struct {
Login string `json:"login"`
}

type Project struct {
Id int `json:"id"`
}

type Issue struct {
Id int `json:"id"`
Subject string `json:"subject"`
Id int `json:"id"`
Subject string `json:"subject"`
Project Project `json:"project"`
}

type IssueWithTitle struct {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/QuickAdd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export const QuickAdd = ({
messages: "0",
// projects: "0" produces weird results.
open_issues: "1",
projects: "1",
};

const foundIssues: { issues: Issue[] } = await fetch(
Expand Down

0 comments on commit 4ef14ad

Please sign in to comment.