Skip to content

Commit

Permalink
Merge pull request #13 from elliotsayes/allow-revouch
Browse files Browse the repository at this point in the history
Don't check isVouched, recalculate & update score
  • Loading branch information
twilson63 authored Dec 9, 2024
2 parents 9f297db + ac50ed8 commit e1b095e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ export function vouch(startdate, address, username, value) {
const sixMonthsAgo = sub(new Date(), { months: 6 })
if (isBefore(parseISO(startdate), sixMonthsAgo)) {
return of({ address, username, value })
.chain(ctx => fromPromise(isVouched)(ctx)
.chain(r => r.ok ? Rejected({ message: 'already vouched' }) : Resolved(ctx))
)
// Allow re-vouching, the main contract will now update the value
//.chain(ctx => fromPromise(isVouched)(ctx)
// .chain(r => r.ok ? Rejected({ message: 'already vouched' }) : Resolved(ctx))
//)
.chain(fromPromise(dispatch))
.chain(fromPromise(sendMessage))
//.chain(fromPromise(writeInteraction))

.toPromise()
} else {
return Promise.reject({ message: 'not qualified.' })
Expand Down

0 comments on commit e1b095e

Please sign in to comment.