class ApplicationInviteController {

    @PutMapping("/accept-invite/{hash}/{userId}")
    public RestResult<Void> acceptInvite( @PathVariable("hash") String hash, @PathVariable("userId") Long userId) {
        return acceptApplicationInviteService.acceptInvite(hash, userId, Optional.empty())
                .andOnSuccessReturn(result -> {
                    crmService.syncCrmContact(userId);
                    return result;
                })
                .toPutResponse();
    }

}