Skip to content

Commit 5940a85

Browse files
committed
fix(law): update model to include voted status in LawService constructor
fix(vote): correct logic for determining if laws are applicable for voting
1 parent 1b997af commit 5940a85

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

apps/api/src/core/democracy/law/law.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { omit } from 'radash'
77

88
@Injectable()
99
export class LawService {
10-
public constructor(@InjectModel(Law.name) public _model: Model<Partial<Law>>) {
10+
public constructor(@InjectModel(Law.name) public _model: Model<Partial<Law & { voted: boolean }>>) {
11+
this._model = _model
1112
}
1213

1314
public async getLaws(playerName: string = ''): Promise<Law[]> {

apps/web/src/pages/democracy/vote.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export default {
165165
const appliedAtTs = new Date(law.appliedAt).getTime()
166166
const currentTs = new Date().getTime()
167167
168-
return appliedAtTs < currentTs
168+
return appliedAtTs > currentTs
169169
})
170170
}
171171
},

0 commit comments

Comments
 (0)