Skip to content

Commit

Permalink
fix(*): make distributionId optionnal
Browse files Browse the repository at this point in the history
  • Loading branch information
MD4 committed Oct 15, 2024
1 parent 3ffe822 commit 4184b6b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/screeb-sdk-browser/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ ___

### surveyStart

**surveyStart**(`surveyId`, `distributionId`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`): `void` \| `Promise`\<`unknown`\>
**surveyStart**(`surveyId`, `distributionId?`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`): `void` \| `Promise`\<`unknown`\>

Starts a survey by its ID.

Expand All @@ -1066,7 +1066,7 @@ Starts a survey by its ID.
| Name | Type | Default value |
| :------ | :------ | :------ |
| `surveyId` | `string` | `undefined` |
| `distributionId` | `string` | `undefined` |
| `distributionId?` | `string` | `undefined` |
| `allowMultipleResponses` | `boolean` | `true` |
| `hiddenFields` | [`PropertyRecord`](README.md#propertyrecord) | `{}` |
| `hooks?` | [`HooksSurveyStart`](README.md#hookssurveystart) | `undefined` |
Expand Down
2 changes: 1 addition & 1 deletion packages/screeb-sdk-browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export const surveyClose = () => callScreebCommand("survey.close");
*/
export const surveyStart = (
surveyId: string,
distributionId: string,
distributionId?: string,
allowMultipleResponses = true,
hiddenFields: PropertyRecord = {},
hooks?: HooksSurveyStart,
Expand Down
10 changes: 5 additions & 5 deletions packages/screeb-sdk-react/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ ___

### SurveyStartFunction

Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `distributionId`: `string`, `allowMultipleResponses`: `boolean`, `hiddenFields`: `PropertyRecord`, `hooks?`: `HooksSurveyStart`, `language?`: `string`) => `Promise`\<`unknown`\>
Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `distributionId?`: `string`, `allowMultipleResponses?`: `boolean`, `hiddenFields?`: `PropertyRecord`, `hooks?`: `HooksSurveyStart`, `language?`: `string`) => `Promise`\<`unknown`\>

Starts a survey by its ID.

Expand All @@ -607,16 +607,16 @@ surveyStart(

#### Type declaration

▸ (`surveyId`, `distributionId`, `allowMultipleResponses`, `hiddenFields`, `hooks?`, `language?`): `Promise`\<`unknown`\>
▸ (`surveyId`, `distributionId?`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`): `Promise`\<`unknown`\>

##### Parameters

| Name | Type |
| :------ | :------ |
| `surveyId` | `string` |
| `distributionId` | `string` |
| `allowMultipleResponses` | `boolean` |
| `hiddenFields` | `PropertyRecord` |
| `distributionId?` | `string` |
| `allowMultipleResponses?` | `boolean` |
| `hiddenFields?` | `PropertyRecord` |
| `hooks?` | `HooksSurveyStart` |
| `language?` | `string` |

Expand Down
6 changes: 3 additions & 3 deletions packages/screeb-sdk-react/src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ export const ScreebProvider: React.FC<
const surveyStart = React.useCallback(
async (
surveyId: string,
distributionId: string,
allowMultipleResponses: boolean,
hiddenFields: Screeb.PropertyRecord,
distributionId?: string,
allowMultipleResponses?: boolean,
hiddenFields?: Screeb.PropertyRecord,
hooks?: Screeb.HooksSurveyStart,
language?: string,
) =>
Expand Down
6 changes: 3 additions & 3 deletions packages/screeb-sdk-react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ export type SurveyCloseFunction = () => Promise<unknown>;
*/
export type SurveyStartFunction = (
surveyId: string,
distributionId: string,
allowMultipleResponses: boolean,
hiddenFields: PropertyRecord,
distributionId?: string,
allowMultipleResponses?: boolean,
hiddenFields?: PropertyRecord,
hooks?: HooksSurveyStart,
language?: string,
) => Promise<unknown>;
Expand Down

0 comments on commit 4184b6b

Please sign in to comment.