Skip to content

Commit

Permalink
upload video link
Browse files Browse the repository at this point in the history
  • Loading branch information
n13 committed Oct 16, 2023
1 parent 0daab06 commit 4f65d05
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/dao.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ namespace pricing {

ACTION castupvote(uint64_t round_id, uint64_t group_id, name voter, uint64_t voted_id);
ACTION uesubmitseed(uint64_t dao_id, eosio::checksum256 seed, name account);
ACTION upvotevideo(uint64_t group_id, name account, std::string link);


ACTION createupvelc(uint64_t dao_id, ContentGroups& election_config);
ACTION editupvelc(uint64_t election_id, ContentGroups& election_config);
Expand Down
3 changes: 2 additions & 1 deletion include/upvote_election/election_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class ElectionGroup : public TypedDocument
DECLARE_DOCUMENT(
Data,
PROPERTY(member_count, int64_t, MemberCount, USE_GETSET),
PROPERTY(winner, int64_t, Winner, USE_GETSET)
PROPERTY(winner, int64_t, Winner, USE_GETSET),
PROPERTY(videolink, string, VideoLink, USE_GETSET)

)
public:
Expand Down
20 changes: 20 additions & 0 deletions src/upvote_election/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,26 @@ namespace hypha {

}

void dao::upvotevideo(uint64_t group_id, name account, std::string link)
{
// Check auth
eosio::require_auth(account);
auto memberId = getMemberID(account);

// Check the group membership of voter and voted
ElectionGroup group(*this, group_id);

EOS_CHECK(
group.isElectionRoundMember(memberId),
"Only members of the group can vote."
);

group.setVideoLink(link);
group.update();

}



/*
election_config: [
Expand Down

0 comments on commit 4f65d05

Please sign in to comment.