function searchAoiJob(){
let param = `
jobLibraryParam:{
jobType : "${jobType}"
machineId : null
lastModifier : null
packageName : null
partName : null
startDay : null
searchCompareYn :${searchCompareYn}
}`;
let machineType = ' machineType : null';
let field = `
{
name
machineId
}
`;
ex>1
function makeQuery(apiName , param , field){
let query = '';
if(param != null){
query = `{${apiName}(${param})${field}}`;
} else {
query = `{${apiName}${field}}`;
}
console.log(query);
return query;
}
query = `{aoiJobLibraryList(${param},${machineType})${field}}`;
console.log(query)
callEndPoint(query , setData, null);
function callEndPoint(query , callback , params){
$.ajax({
url: '/graphql',
contentType: "application/json",
type:'POST',
data: JSON.stringify({ query : query}),
success: function(result) {
if(typeof params != 'undefined' && params != null){
result.data.params = params;
}
callback( result.data ); # calls callback func
}
});
}