다음 JSON을 /invites.json API 엔드포인트에 POST 요청으로 보내고 있습니다:
{
"email": "new.member@example.com",
"skip_email": true,
"max_redemptions_allowed": 1,
"expires_at": << 현재 날짜 + 1개월 >>
"group_names": "example_group"
}
이로써 유효한 초대장이 생성되며, 해당 초대 링크를 가져와 사용자에게 제공합니다.
그러나 사용자가 초대장을 사용하려고 할 때, discourse/app/controllers/invites_controller.rb at main · discourse/discourse · GitHub 에서 데이터베이스 업데이트 실패로 인해 일반적인 invite.error_message 오류가 발생합니다.
코드를 추적해 보았지만, 눈에 띄는 명확한 문제는 발견하지 못했습니다.
invites 테이블의 레코드 예시는 다음과 같습니다:
id | invite_key | email | invited_by_id | user_id | redeemed_at | created_at | updated_at | deleted_at | deleted_by_id | invalidated_at | moderator | custom_message | emailed_status | max_redemptions_allowed | redemption_count | expires_at
1587 | 4b4e........................2307 | example@gmail.com | 1 | | | 2021-04-11 23:51:05.253528 | 2021-04-11 23:51:05.253528 | | | | f | | 0 | 1 | 0 | 2021-05-11 11:51:05.193