Skip to content

Commit

Permalink
feat: twitterHandle prevent to be undf
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthh committed Oct 5, 2023
1 parent 450fcf8 commit 28e7b21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/services/apecoin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ async function fetchDelegates(daoName: string, publicAddress?: string) {
"u"."publicAddress",
"t2"."offChainVotesPct",
"t1"."snapshotDelegatedVotes" as "balance",
"t3"."handle"
"t3"."handle",
"u"."twitterHandle"
FROM "Delegate" AS t1
INNER JOIN "User" as u on "t1"."userId" = "u"."id"
INNER JOIN "DelegateStat" AS t2 ON "t1"."id" = "t2"."delegateId"
Expand Down Expand Up @@ -82,6 +83,8 @@ async function delegateHasPermission(delegate, dao) {
delegate.hasPermission = delegate.hasPermission || delegate.trustLevel >= 2;
}

if (!delegate.twitterHandle) delegate.hasPermission = false;

return delegate;
}

Expand Down

0 comments on commit 28e7b21

Please sign in to comment.