Skip to content

Commit

Permalink
Merge pull request #561 from chhsiao1981/board-parent
Browse files Browse the repository at this point in the history
board.ParentID from gid or boardd.Parent
  • Loading branch information
chhsiao1981 authored Oct 2, 2024
2 parents fe9af1a + e19ae62 commit 7ca86fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion schema/board_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var (
)

func NewBoardSummary(b_b *bbs.BoardSummary, updateNanoTS types.NanoTS) *BoardSummary {
parentID, _ := GetBoardIDByBid(b_b.Bid)
parentID, _ := GetBoardIDByBid(b_b.Gid)

return &BoardSummary{
BBoardID: b_b.BBoardID,
Expand Down Expand Up @@ -95,6 +95,8 @@ func NewBoardSummaryFromPBBoard(b_b *boardd.Board, updateNanoTS types.NanoTS) *B
boardType = "Σ"
}

parentID, _ := GetBoardIDByBid(ptttype.Bid(b_b.Parent))

return &BoardSummary{
BBoardID: bboardID,
Brdname: b_b.Name,
Expand All @@ -107,6 +109,7 @@ func NewBoardSummaryFromPBBoard(b_b *boardd.Board, updateNanoTS types.NanoTS) *B

UpdateNanoTS: updateNanoTS,

ParentID: parentID,
Gid: ptttype.Bid(b_b.Parent),
Bid: ptttype.Bid(b_b.Bid),
IdxByName: idxByName,
Expand Down
2 changes: 2 additions & 0 deletions schema/board_summary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ func TestNewBoardSummaryFromPBBoard(t *testing.T) {
Total: 234,
NUser: 12345,

ParentID: "1_test1",

Gid: 1,
Bid: 7,
IdxByName: "test",
Expand Down

0 comments on commit 7ca86fc

Please sign in to comment.