preview
This commit is contained in:
@ -26,21 +26,34 @@ export const updateDog = async ({email, name, phone}:
|
||||
}
|
||||
}
|
||||
|
||||
export const getDog = async ( str: string | undefined) : Promise<ResponseT> =>
|
||||
export const getDog = async ( params: string[] | undefined) : Promise<ResponseT> =>
|
||||
{
|
||||
var ret: ResponseT = {};
|
||||
let qrid = '';
|
||||
|
||||
if(params !== undefined && params.length >= 2)
|
||||
{
|
||||
qrid = params[1];
|
||||
}
|
||||
if(params !== undefined && params.length == 1)
|
||||
{
|
||||
qrid = params[0];
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ret = await Axios.post<ResponseT>('getDog.php',
|
||||
{
|
||||
qr_id: str
|
||||
qr_id: qrid
|
||||
});
|
||||
console.log('Api getDog');
|
||||
console.log(ret.data);
|
||||
|
||||
return ret.data as ResponseT;
|
||||
}
|
||||
catch (error:any)
|
||||
{
|
||||
console.log('error message: ', error.message);
|
||||
console.log('Api getDog error message: ', error.message);
|
||||
ret =
|
||||
{
|
||||
success: 0,
|
||||
|
||||
Reference in New Issue
Block a user