async function getPhotoLabels()

in src/components/photos/Photos.js [15:34]


async function getPhotoLabels(key) {
  const apiName = 'imageAPI';
  const path = '/images'; 

  const myInit = { // OPTIONAL
    headers: { 
      'Content-Type': 'application/json'
    },
    response: true, // OPTIONAL (return the entire Axios response object instead of only response.data)
    queryStringParameters: {  // OPTIONAL
      action: 'getLabels',
      key: key
    },
  };

  let apiResponse = await API.get(apiName, path, myInit);
  let results = [ apiResponse ];

  return Promise.resolve(results);
}