createCachedCollection: async function()

in amplify/backend/function/idvworkflowfn/src/graphqlhelpers.js [220:248]


  createCachedCollection: async function (collectionEntry) {

    const input = {
      configroot: 'cachedcollectionlist',
      collectionid: collectionEntry.CollectionId,
      arn: collectionEntry.CollectionARN.replace(":", "-").replace("/", "-"),
      created: "2021-09-29", //Date.parse(collectionEntry.CreationTimestamp),
      facemodel: collectionEntry.FaceModelVersion
    };

    var response = {
      Success: false,
      Message: ''
    };

    var data = await issueGQL(createCachedCollectionList, "CreateCachedCollectionList", { input: input });

    if (!data ||
      !data.createCachedCollectionList ||
      !data.createCachedCollectionList.collectionid) {
      response.Success = false;
      response.Message = "Unable to create cached collection entry";
    }
    else {
      response.Success = true;
    }

    return response;
  },