31 lines
843 B
TypeScript
31 lines
843 B
TypeScript
import { IntranetDashboardDto } from '@/proxy/intranet/models'
|
|
import apiService, { Config } from './api.service'
|
|
|
|
export class IntranetService {
|
|
apiName = 'Default'
|
|
|
|
getDashboard = (config?: Partial<Config>) =>
|
|
apiService.fetchData<IntranetDashboardDto>(
|
|
{
|
|
method: 'GET',
|
|
url: '/api/app/intranet/intranet-dashboard',
|
|
},
|
|
{ apiName: this.apiName, ...config },
|
|
)
|
|
|
|
updateSurveyResponse = (
|
|
surveyId: string,
|
|
answers: { questionId: string; questionType: string; value: string }[],
|
|
config?: Partial<Config>,
|
|
) =>
|
|
apiService.fetchData<void>(
|
|
{
|
|
method: 'POST',
|
|
url: '/api/app/intranet/update-survey-response',
|
|
data: { surveyId, answers },
|
|
},
|
|
{ apiName: this.apiName, ...config },
|
|
)
|
|
}
|
|
|
|
export const intranetService = new IntranetService()
|