Method: NotionOrbit::Interactions::Note#after_initialize!

Defined in:
lib/notion_orbit/interactions/note.rb

#after_initialize!Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/notion_orbit/interactions/note.rb', line 17

def after_initialize!
    orbit_service = NotionOrbit::Services::Orbit.new(orbit_workspace: @orbit_workspace, orbit_api_key: @orbit_api_key)
    notion_service = NotionOrbit::Services::Notion.new(notion_api_key: @notion_api_key)

    orbit_service.send_note(
        member_slug: @note[:member_slug],
        api_key: @orbit_api_key,
        content: @note[:content]
    )

    notion_service.mark_note_as_synced(@note[:page_id], orbit_note_url(@note[:member_slug]))
end