export type SurveyQuestionChoiceRqst = {txtChoise?: (string | null) | undefined, order?: number | undefined}; export type SurveyQuestionRqst = {surveyQuestionTypeID?: number | undefined, txtQuestion?: (string | null) | undefined, surveyAnswerType?: (string | null) | undefined, updateProfileInfoID?: (number | null) | undefined, surveyQuestionChoices?: (Array | null) | undefined}; export type CreateUpdateSurveyRqst = {surveyID?: number | undefined, title?: (string | null) | undefined, description?: (string | null) | undefined, startDate?: string | undefined, finishDate?: string | undefined, timeSeconds?: number | undefined, isActive?: boolean | undefined, isUpdateProfileInfo?: boolean | undefined, surveyQuestions?: (Array | null) | undefined}; export type CreateApiV1ApiSurveyCreateSurveyArgs = {body: CreateUpdateSurveyRqst}; export type CreateApiV1ApiSurveyCreateSurveyOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/api/Survey/CreateSurvey */ export const createApiV1ApiSurveyCreateSurvey = async (args: CreateApiV1ApiSurveyCreateSurveyArgs, options: CreateApiV1ApiSurveyCreateSurveyOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/v1/api/Survey/CreateSurvey${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };