📊
Pollz
  • Introduction
  • Quickstart
  • Guides
    • Initializing your app
    • Create a Poll
    • Vote for a Poll
    • Retrieve a Poll
    • Manage Poll Options
    • Listen to update
    • Anonymous Poll
  • Components
    • React
    • React Native
    • Embedded
  • API Reference
    • init()
    • pollOptions()
      • addOption()
      • deleteOption()
      • renameOption()
    • anonymous
      • createAnonymousToken()
      • getAnonymousPoll()
      • voteAnonymously()
    • polls
      • create()
      • get()
      • getAll()
      • vote()
      • rename()
      • deleteOne()
      • listen()
    • pollTypes
      • getAll()
  • Tooling
    • Typescript
    • React
      • usePoll()
      • usePolls()
      • usePollz()
      • usePollTypes()
      • useAnonymousPoll()
Powered by GitBook
On this page
  1. API Reference
  2. pollOptions()

renameOption()

renameOption(optionId: number, name: string): Promise<{ id: number; name: string; }>

Rename a poll option.

Parameters:

  • optionId (number): The ID of the option to be renamed.

  • name (string): The new name for the option.

Returns:

  • A Promise resolving to an object containing the ID and the new name of the renamed option.

Example:

const updatedOption = await pollOptions.renameOption(1, 'Updated Option');
console.log('Poll Option Renamed:', updatedOption);
PreviousdeleteOption()Nextanonymous

Last updated 1 year ago