Skip to content

Commit

Permalink
fix(*): fix survey.start command - added distribution id
Browse files Browse the repository at this point in the history
  • Loading branch information
MD4 committed Oct 8, 2024
1 parent 26b5df4 commit 238c0a6
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/screeb-sdk-angular/docs/classes/Screeb.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ ___

### surveyStart

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

Starts a survey by its ID.

Expand All @@ -510,6 +510,7 @@ Starts a survey by its ID.
| Name | Type |
| :------ | :------ |
| `surveyId` | `string` |
| `distributionId` | `string` |
| `allowMultipleResponses` | `boolean` |
| `hiddenFields` | `PropertyRecord` |
| `hooks?` | `Hooks` |
Expand All @@ -523,6 +524,7 @@ Starts a survey by its ID.

```ts
this.screeb.surveyStart(
'<UUID>',
'<UUID>',
false,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ export class Screeb {
* ```ts
* this.screeb.surveyStart(
* '<UUID>',
* '<UUID>',
* false,
* {
* color: "green",
Expand All @@ -321,6 +322,7 @@ export class Screeb {
*/
public async surveyStart(
surveyId: string,
distributionId: string,
allowMultipleResponses: boolean,
hiddenFields: _Screeb.PropertyRecord,
hooks?: _Screeb.Hooks,
Expand All @@ -330,6 +332,7 @@ export class Screeb {

return _Screeb.surveyStart(
surveyId,
distributionId,
allowMultipleResponses,
hiddenFields,
hooks,
Expand Down
4 changes: 3 additions & 1 deletion packages/screeb-sdk-browser/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ ___

### surveyStart

**surveyStart**(`surveyId`, `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 @@ -887,6 +887,7 @@ Starts a survey by its ID.
| Name | Type | Default value |
| :------ | :------ | :------ |
| `surveyId` | `string` | `undefined` |
| `distributionId` | `string` | `undefined` |
| `allowMultipleResponses` | `boolean` | `true` |
| `hiddenFields` | [`PropertyRecord`](README.md#propertyrecord) | `{}` |
| `hooks?` | [`Hooks`](README.md#hooks) | `undefined` |
Expand All @@ -902,6 +903,7 @@ Starts a survey by its ID.
import * as Screeb from "@screeb/sdk-browser";

Screeb.surveyStart(
'<UUID>',
'<UUID>',
false,
{
Expand Down
3 changes: 3 additions & 0 deletions packages/screeb-sdk-browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ export const surveyClose = () => callScreebCommand("survey.close");
*
* Screeb.surveyStart(
* '<UUID>',
* '<UUID>',
* false,
* {
* color: "green",
Expand All @@ -446,12 +447,14 @@ export const surveyClose = () => callScreebCommand("survey.close");
*/
export const surveyStart = (
surveyId: string,
distributionId: string,
allowMultipleResponses = true,
hiddenFields: PropertyRecord = {},
hooks?: Hooks,
language?: string,
) =>
callScreebCommand("survey.start", surveyId, {
distribution_id: distributionId,
allow_multiple_responses: allowMultipleResponses,
language: language,
hidden_fields: hiddenFields,
Expand Down
6 changes: 4 additions & 2 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`, `allowMultipleResponses`: `boolean`, `hiddenFields`: `PropertyRecord`, `hooks?`: `Hooks`, `language?`: `string`) => `Promise`\<`unknown`\>
Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `distributionId`: `string`, `allowMultipleResponses`: `boolean`, `hiddenFields`: `PropertyRecord`, `hooks?`: `Hooks`, `language?`: `string`) => `Promise`\<`unknown`\>

Starts a survey by its ID.

Expand All @@ -595,6 +595,7 @@ Starts a survey by its ID.
const { surveyStart } = useScreeb();

surveyStart(
'<UUID>',
'<UUID>',
false,
{
Expand All @@ -606,13 +607,14 @@ surveyStart(

#### Type declaration

▸ (`surveyId`, `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` |
| `hooks?` | `Hooks` |
Expand Down
2 changes: 2 additions & 0 deletions packages/screeb-sdk-react/src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export const ScreebProvider: React.FC<
const surveyStart = React.useCallback(
async (
surveyId: string,
distributionId: string,
allowMultipleResponses: boolean,
hiddenFields: Screeb.PropertyRecord,
hooks?: Screeb.Hooks,
Expand All @@ -205,6 +206,7 @@ export const ScreebProvider: React.FC<
await ensureScreeb("surveyStart", () =>
Screeb.surveyStart(
surveyId,
distributionId,
allowMultipleResponses,
hiddenFields,
hooks,
Expand Down
2 changes: 2 additions & 0 deletions packages/screeb-sdk-react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ export type SurveyCloseFunction = () => Promise<unknown>;
*
* surveyStart(
* '<UUID>',
* '<UUID>',
* false,
* {
* color: "green",
Expand All @@ -343,6 +344,7 @@ export type SurveyCloseFunction = () => Promise<unknown>;
*/
export type SurveyStartFunction = (
surveyId: string,
distributionId: string,
allowMultipleResponses: boolean,
hiddenFields: PropertyRecord,
hooks?: Hooks,
Expand Down

0 comments on commit 238c0a6

Please sign in to comment.