Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge this branch to help fix build issues. #9022

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libs/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const AppEnvironments = [
'discobot',
'snapshot',
] as const;
type Environment = typeof Environments[number];
type AppEnvironment = typeof AppEnvironments[number];
type Environment = (typeof Environments)[number];
type AppEnvironment = (typeof AppEnvironments)[number];

/**
* Extends target config with payload after validating schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ export async function __deleteCommunity(
}

await this.models.Collaboration.destroy({
// @ts-expect-error StrictNullChecks
where: {
thread_id: { [Op.in]: threads.map((thread) => thread.id) },
thread_id: { [Op.in]: threads.map((thread) => thread.id!) },
},
transaction: t,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,5 @@ export async function __updateCommunityId(
});
});

// @ts-expect-error StrictNullChecks
return newCommunity.toJSON();
return newCommunity!.toJSON();
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ export const createCommentReactionHandler = async (
}

const commentReactionFields: CreateCommentReactionOptions = {
// @ts-expect-error <StrictNullChecks>
user,
// @ts-expect-error <StrictNullChecks>
address,
user: user!,
address: address!,
reaction,
commentId,
};
Expand Down
3 changes: 1 addition & 2 deletions packages/commonwealth/server/routes/createAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ const createAddress = async (
req: TypedRequestBody<CreateAddressReq>,
res: TypedResponse<CreateAddressResp>,
) => {
// @ts-expect-error StrictNullChecks
const user = req.body.user;
const user = req.user;

// start the process of creating a new address. this may be called
// when logged in to link a new address for an existing user, or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const linkExistingAddressToCommunity = async (
);
}

const updatedObj = await models.Address.update(
const [, updatedObj] = await models.Address.update(
{
user_id: userId,
verification_token: verificationToken,
Expand All @@ -140,10 +140,10 @@ const linkExistingAddressToCommunity = async (
verified: originalAddress.verified,
hex,
},
{ where: { id: existingAddress.id }, transaction },
{ where: { id: existingAddress.id }, transaction, returning: true },
);
// @ts-expect-error StrictNullChecks
addressId = updatedObj.id;

addressId = updatedObj[0]!.id!;
});
} else {
const newObj = await models.sequelize.transaction(async (transaction) => {
Expand Down
3 changes: 1 addition & 2 deletions packages/commonwealth/server/routes/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,11 @@ export const status = async (

return success(res, {
loggedIn: true,
// @ts-expect-error StrictNullChecks
user,
communityWithRedirects: communityWithRedirects || [],
evmTestEnv: config.TEST_EVM.ETH_RPC,
enforceSessionKeys: config.ENFORCE_SESSION_KEYS,
});
} as StatusResp);
}
} catch (error) {
console.log(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ export const createThreadReactionHandler = async (
}

const reactionFields: CreateThreadReactionOptions = {
// @ts-expect-error <StrictNullChecks>
user,
// @ts-expect-error <StrictNullChecks>
address,
user: user!,
address: address!,
reaction,
threadId,
};
Expand Down
Loading