import DeviceInfo from 'react-native-device-info';
import { SERVICE_HOST } from './../ServiceUrl'
import Axios from 'axios';

let baseUrl = SERVICE_HOST

export function signToken() {
    return Axios.get(baseUrl + "/token/sign", {
        "id": DeviceInfo.getUniqueID()
    })
}

export function verifyToken(token) {
    return Axios.get(baseUrl + "/token/verify", {
        headers: {'api-key': token}
    })
}

export function searchMedication(apiKey, queryString) {
    return Axios.get(baseUrl + "/drugs/search", {
        headers: {'api-key': apiKey},
        params: {'input': queryString}
    })
}