This commit is contained in:
2023-02-02 11:12:55 +01:00
parent 6c15821467
commit e1387b6f36
3 changed files with 95 additions and 78 deletions

View File

@ -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,