diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e9e33261..90954bacd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/govtool/frontend/src/hooks/mutations/useDRepRegisterMutation.ts b/govtool/frontend/src/hooks/mutations/useDRepRegisterMutation.ts index 76b79287d..d757d09b2 100644 --- a/govtool/frontend/src/hooks/mutations/useDRepRegisterMutation.ts +++ b/govtool/frontend/src/hooks/mutations/useDRepRegisterMutation.ts @@ -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, + }); }, }); diff --git a/govtool/frontend/src/hooks/mutations/useDRepRetireMutation.ts b/govtool/frontend/src/hooks/mutations/useDRepRetireMutation.ts index b3697c714..8bf8973e1 100644 --- a/govtool/frontend/src/hooks/mutations/useDRepRetireMutation.ts +++ b/govtool/frontend/src/hooks/mutations/useDRepRetireMutation.ts @@ -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."); }, }); diff --git a/govtool/frontend/src/hooks/queries/useGetDRepVotingPowerQuery.ts b/govtool/frontend/src/hooks/queries/useGetDRepVotingPowerQuery.ts index 5df7a3af1..836946aa9 100644 --- a/govtool/frontend/src/hooks/queries/useGetDRepVotingPowerQuery.ts +++ b/govtool/frontend/src/hooks/queries/useGetDRepVotingPowerQuery.ts @@ -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 }; diff --git a/govtool/frontend/src/models/api.ts b/govtool/frontend/src/models/api.ts index 03fec9e2b..5281e2a9e 100644 --- a/govtool/frontend/src/models/api.ts +++ b/govtool/frontend/src/models/api.ts @@ -1,7 +1,7 @@ export interface DRepInfo { isRegistered: boolean; wasRegistered: boolean; - deposit: number; + deposit: number | null; } export interface DRepData {