Skip to content

Commit

Permalink
feat(question): add points to view
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoAcosta committed Nov 1, 2024
1 parent 96177ca commit 6692499
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/questions/Question.sol
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ abstract contract Question is Ownable, IQuestion {

/// @inheritdoc IQuestionView
function getQuestionView(address user) external view returns (QuestionView memory) {
return QuestionView(_questionData(), _questionUser(user), _optionsViews(user));
return QuestionView(_questionData(), _questionUser(user), _optionsViews(user), points.getPointsView(user));
}

/// @inheritdoc IQuestionView
function getQuestionPreview(address user) external view returns (QuestionPreview memory) {
return QuestionPreview(_questionData(), _questionUser(user));
return QuestionPreview(_questionData(), _questionUser(user), points.getPointsView(user));
}
}
4 changes: 4 additions & 0 deletions src/questions/interfaces/IQuestionView.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import { IPointsView } from "../../points/interfaces/IPointsView.sol";

/// @title Question View Interface
/// @notice Interface for retrieving question and option data for users
/// @dev This interface defines structures and functions for viewing question details
Expand Down Expand Up @@ -60,6 +62,7 @@ interface IQuestionView {
struct QuestionPreview {
QuestionData data;
QuestionUser user;
IPointsView.PointsView points;
}

/// @notice Struct containing comprehensive question view data
Expand All @@ -68,6 +71,7 @@ interface IQuestionView {
QuestionData data;
QuestionUser user;
OptionView[] options;
IPointsView.PointsView points;
}

/// @notice Get a comprehensive view of the question for a specific user
Expand Down

0 comments on commit 6692499

Please sign in to comment.