Skip to content

Commit 0147382

Browse files
committed
Feat: Set relevant user stake type on creation
1 parent c0ae1d9 commit 0147382

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/handlers/expenditures/expenditureMadeViaStake.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
UpdateExpenditureDocument,
1111
UpdateExpenditureMutation,
1212
UpdateExpenditureMutationVariables,
13+
UserStakeType,
1314
} from '~graphql';
1415
import { EventHandler } from '~types';
1516
import { getExpenditureDatabaseId, output, toNumber, verbose } from '~utils';
@@ -65,6 +66,7 @@ export const handleExpenditureMadeViaStake: EventHandler = async (
6566
userAddress: creator,
6667
colonyAddress,
6768
isClaimed: false,
69+
type: UserStakeType.StakedExpenditure,
6870
},
6971
},
7072
);

src/handlers/motions/motionStaked/helpers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
UpdateUserStakeMutation,
1515
UpdateUserStakeMutationVariables,
1616
UserMotionStakes,
17+
UserStakeType,
1718
} from '~graphql';
1819
import { mutate, query } from '~amplifyClient';
1920
import { getUserStakeDatabaseId } from '~utils/stakes';
@@ -332,6 +333,7 @@ export const updateUserStake = async (
332333
amount: amount.toString(),
333334
isClaimed: false,
334335
createdAt: new Date(timestamp * 1000).toISOString(),
336+
type: UserStakeType.Motion,
335337
},
336338
},
337339
);

0 commit comments

Comments
 (0)