public FrontComment(ClubRequest clubRequest, Account authorAccount, bool isMember) { IsMember = isMember; ClubRequestBool = true; ClubId = clubRequest.ClubId; ClubRequestText = clubRequest.Text; ClubRequestUsername = authorAccount.Username; ClubRequestInstance = clubRequest; }
/// create a request to join a club; returns true if success, false if the user has already requested to join /// TODO: im making it as though a single user votes, but how is it accepted or rejected?f public async Task<bool> CreateClubRequest(string text, string clubId) { var list = await clubRequestTable.Where(item => item.AccountId == User.Id && item.ClubId == clubId).ToListAsync(); if (list.Count > 0) { return false; } else { ClubRequest clubRequest = new ClubRequest(User.Id, clubId, text); await clubRequestTable.InsertAsync(clubRequest); return true; } }