fix example
Some checks failed
Build / build (push) Has been cancelled
Build / build (pull_request) Failing after 1m32s

This commit is contained in:
Sainan 2025-05-09 05:53:56 +02:00
parent 30861756af
commit 956c4ea8cf

View File

@ -83,7 +83,7 @@ export const removeFriendPostController: RequestHandler = async (req, res) => {
} satisfies IRemoveFriendsResponse) } satisfies IRemoveFriendsResponse)
}; };
// The friend ids format is a bit weird, e.g. when 6633b81e9dba0b714f28ff02 (A) is friends with 681c8df04773f7c2809b856c (B), A's friend id for B is 808000f04773f70530e4a0c2 and B's friend id for A is 8000b81e9dba0b06408a8075. // The friend ids format is a bit weird, e.g. when 6633b81e9dba0b714f28ff02 (A) is friends with 67cdac105ef1f4b49741c267 (B), A's friend id for B is 808000105ef1f40560ca079e and B's friend id for A is 8000b81e9dba0b06408a8075.
const checkFriendId = (friendId: string, b: Types.ObjectId): boolean => { const checkFriendId = (friendId: string, b: Types.ObjectId): boolean => {
return friendId.substring(6, 6 + 8) == b.toString().substring(6, 6 + 8); return friendId.substring(6, 6 + 8) == b.toString().substring(6, 6 + 8);
}; };