tianji/packages/client-sdk/src/survey.ts

27 lines
490 B
TypeScript
Raw Normal View History

2024-04-28 14:58:58 +00:00
import { SurveyService } from './open/client';
export async function getSurveyInfo(workspaceId: string, surveyId: string) {
const survey = await SurveyService.surveyGet({
workspaceId,
surveyId,
});
return survey;
}
export async function submitSurvey(
workspaceId: string,
surveyId: string,
payload: Record<string, any>
) {
const res = await SurveyService.surveySubmit({
workspaceId,
surveyId,
requestBody: {
payload,
},
});
return res;
}