@@ -15,10 +15,11 @@ exports.SafeDaosResponseSchema = zod_1.z.object({
1515 return { daos : { items : [ ] } } ;
1616 }
1717 return { daos : { items : data . daos . items } } ;
18- } ) . catch ( ( ) => {
19- console . warn ( 'DaosResponse validation failed completely' ) ;
20- return { daos : { items : [ ] } } ;
2118} ) ;
19+ // .catch(() => {
20+ // console.warn('DaosResponse validation failed completely');
21+ // return { daos: { items: [] } };
22+ // });
2223exports . SafeProposalsResponseSchema = zod_1 . z . object ( {
2324 proposalsOnchains : zod_1 . z . object ( {
2425 items : zod_1 . z . array ( zod_1 . z . any ( ) )
@@ -29,16 +30,18 @@ exports.SafeProposalsResponseSchema = zod_1.z.object({
2930 return { proposalsOnchains : { items : [ ] } } ;
3031 }
3132 return { proposalsOnchains : { items : data . proposalsOnchains . items } } ;
32- } ) . catch ( ( ) => {
33- console . warn ( 'ProposalsResponse validation failed completely' ) ;
34- return { proposalsOnchains : { items : [ ] } } ;
3533} ) ;
34+ // .catch(() => {
35+ // console.warn('ProposalsResponse validation failed completely');
36+ // return { proposalsOnchains: { items: [] } };
37+ // });
3638exports . SafeProposalByIdResponseSchema = zod_1 . z . object ( {
3739 proposalsOnchain : zod_1 . z . any ( ) . nullable ( )
38- } ) . catch ( ( ) => {
39- console . warn ( 'ProposalByIdResponse validation failed completely' ) ;
40- return { proposalsOnchain : null } ;
4140} ) ;
41+ // .catch(() => {
42+ // console.warn('ProposalByIdResponse validation failed completely');
43+ // return { proposalsOnchain: null };
44+ // });
4245// Define schema for voting power history item (based on actual API response)
4346// Handle real-world scenarios where API might return null values or missing fields
4447const VotingPowerHistoryItemSchema = zod_1 . z . object ( {
@@ -67,9 +70,6 @@ exports.SafeVotingPowerHistoryResponseSchema = zod_1.z.object({
6770 return {
6871 votingPowerHistorys : data . votingPowerHistorys || { items : [ ] }
6972 } ;
70- } ) . catch ( ( ) => {
71- console . warn ( 'VotingPowerHistoryResponse validation failed, returning empty data' ) ;
72- return { votingPowerHistorys : { items : [ ] } } ;
7373} ) ;
7474// Internal helper function to process validated proposals
7575function processProposals ( validated , daoId ) {
0 commit comments