Class: Reattract::InviteCode

Inherits:
Object
  • Object
show all
Defined in:
lib/reattract/resources/invite_code.rb

Overview

/v1/invite_codes

Class Method Summary collapse

Class Method Details

.create(user_id:, campaign_id: nil) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/reattract/resources/invite_code.rb', line 7

def create(user_id:, campaign_id: nil)
  collection_request.post(
    body: {
      organization_user_id: user_id,
      campaign_id:          campaign_id
    }
  )
end

.list(limit: 20, page: 1, order: ['id desc']) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/reattract/resources/invite_code.rb', line 16

def list(limit: 20, page: 1, order: ['id desc'])
  collection_request.get(
    sort:       order,
    pagination: {
      limit: limit,
      page:  page
    }
  )
end