Skip to content

fix feature invite member#49

Open
TMTzMinhTri wants to merge 3 commits intodevfrom
teams
Open

fix feature invite member#49
TMTzMinhTri wants to merge 3 commits intodevfrom
teams

Conversation

@TMTzMinhTri
Copy link
Copy Markdown
Contributor

No description provided.

),
cancelInvitation: combineResolvers(
isAuthenticated,
(_, { userId, teamId }) => cancelInvitation(userId, teamId),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chỗ này phải dùng user đang đăng nhập chứ không gửi userId, dùng userId sẽ dẫn tới XSS. Một user đăng nhập khác có thể cancel invitation của bất kỳ user nào trong hệ thống.

});
const dispatch = useDispatch()
const [InviteMemberMutation, { loading, error }] = useMutation(InviteMemberQuery);
const [CancelInvitationMutation] = useMutation(CancelInvitationQuery);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mấy cái mutation nên viết thường chữ đầu tiên.

<button type="button" className="mr-4 hover:underline hover:text-blue-800 cursor-pointer text-blue-500">Cancle</button>
<button
type="button"
onClick={() => handleAction({ type: 'cancel', member: it })}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tạo function cho cái onClick

user_id: userId,
}, { status: 'inactive' }, transaction));

queries.push(updateTeamInvitation({ email: user.email }, { status: 'inactive' }, transaction));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chỗ này phải update là decline?

export async function cancelInvitation(userId, teamId) {
let transaction;
try {
transaction = await database.transaction();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cần kiểm tra là invitation có đang active hay không?

@salmanbbi
Copy link
Copy Markdown

When are you planing to update this? I can see other issues also which are there. Any plan to release them? I am thinking to use this as base for my project but it seems to be not updated recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants