Skip to content

Commit

Permalink
[#280] Fix get drep voting power request
Browse files Browse the repository at this point in the history
  • Loading branch information
MSzalowski committed Feb 23, 2024
1 parent 0c46e1b commit 1a49358
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ changes.
- Fixed vote calculation problems related to NoConfidence DRep [Issue 59](https://github.com/IntersectMBO/govtool/issues/59)
- Fixed ada-holder/get-current-delegation error when delegated to NoConfidence or AlwaysAbstain dreps. [Issue 82](https://github.com/IntersectMBO/govtool/issues/82)
- Fixed deployment scripts to address [Issue 171](https://github.com/IntersectMBO/govtool/issues/171).
- Fixed get drep voting power incorrectly executed endpoint [Issue 280](https://github.com/IntersectMBO/govtool/issues/280)

### Changed
- Update Cardano-Serialization-Lib to 12.0.0-alpha.16 [Issue 156](https://github.com/IntersectMBO/govtool/issues/156)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ export const useDRepRegisterMutation = () => {

const { mutateAsync, isLoading } = useMutation(postDRepRegister, {
onSuccess: () => {
setDRep({ deposit: 100, isRegistered: true, wasRegistered: false });
setDRep({
deposit: 100,
isRegistered: true,
wasRegistered: false,
});
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ export const useDRepRetireMutation = () => {

const { mutateAsync } = useMutation(postDRepRetire, {
onSuccess: () => {
setDRep({ deposit: 100, wasRegistered: true, isRegistered: false });
setDRep({
deposit: 100,
wasRegistered: true,
isRegistered: false,
});
addSuccessAlert("DRep retired.");
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const useGetDRepVotingPowerQuery = () => {
queryFn: async () => {
return await getDRepVotingPower({ dRepID });
},
enabled: !!dRepID && dRep?.isRegistered,
enabled: !!dRepID && !!dRep?.isRegistered,
});

return { dRepVotingPower: data, isDRepVotingPowerLoading: isLoading };
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/models/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface DRepInfo {
isRegistered: boolean;
wasRegistered: boolean;
deposit: number;
deposit: number | null;
}

export interface DRepData {
Expand Down

0 comments on commit 1a49358

Please sign in to comment.