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 UpdateApiV1ApiSurveyUpdateSurveySurveyIdArgs = {surveyId: number, body: CreateUpdateSurveyRqst}; export type UpdateApiV1ApiSurveyUpdateSurveySurveyIdOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /v1/api/Survey/UpdateSurvey/{surveyId} */ export const updateApiV1ApiSurveyUpdateSurveySurveyId = async (args: UpdateApiV1ApiSurveyUpdateSurveySurveyIdArgs, options: UpdateApiV1ApiSurveyUpdateSurveySurveyIdOptions) => { 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/UpdateSurvey/${encodeURIComponent(String(args.surveyId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };