import axios from 'axios'; export interface View { internal_id: string; view_id: string; view_name: string; view_name_local: string; view_other_name: string; view_description: string; view_position: string; application: string; anatomic_region: string; patient_type: string; body_part_id: string; view_icon_name: string; view_big_icon_name: string; view_coach_name: string; modality: string; work_station_id: number; apr_id: string; img_proc_id: string; // config_object: any; sort: number; is_enabled: boolean; product: string; is_pre_install: boolean; procedure_id?: string; } interface FetchViewsResponse { code: string; description: string; solution: string; data: { '@type': string; view_list: View[]; }; } export const fetchViews = async ( patient_type: string | null, body_part: string | null, is_enabled: boolean, procedure_id: string | null | undefined ): Promise => { const response = await axios.get('/dr/api/v1/auth/protocol/view', { //todo get header info // authorization: string, // language: 'en' | 'zh', // product: 'DROS' | 'VETDROS', // source: 'Electron' | 'Browser' | 'Android' headers: { Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTEyNzc5NzAsImlkIjoxLCJuYW1lIjoiYWRtaW4ifQ.ooTGwBXaNhtunbKbpqteWbjDwJLjnRmSIl80r5dp1pY', Language: 'en', Product: 'DROS', Source: 'Electron', }, params: { patient_type, body_part, is_enabled, procedure_id, }, }); return response.data; };