From 090b307919c3933fc6e5c03816cbbbc648f567c9 Mon Sep 17 00:00:00 2001
From: bertrand <bpinel@ippon.fr>
Date: Sun, 30 Dec 2018 17:15:47 +0100
Subject: [PATCH] Add support to provided property for selection in
 relationship (default to id)

---
 blueprints/entity-factory/index.js |  4 ++--
 cloud/lambda-jsonapi-test.js       | 10 ++--------
 cloud/lambda/lambda-jsonapi.js     |  4 ----
 package.json                       |  2 +-
 4 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/blueprints/entity-factory/index.js b/blueprints/entity-factory/index.js
index 2e9506e..8e89c15 100644
--- a/blueprints/entity-factory/index.js
+++ b/blueprints/entity-factory/index.js
@@ -211,13 +211,13 @@ function templateEntityForm(name, options) {
         break;
 
       case 'belongs-to':
-        form.push('\t\t\t{{f.input type="select" label="'+prop+'" name="'+prop+ " \n"+
+        form.push('\t\t\t{{f.input type="select" label="'+prop+'" name="'+prop+ '" \n'+
               'options='+inflection.pluralize(targetEntity)+' optionLabelPath="'+mapBy+'" optionValuePath="id" \n'+
               'includeBlank= "Please choose..." promptIsSelectable=false}}');
         break;
 
       case 'has-many':
-        form.push('\t\t\t{{f.input type="select" label="'+prop+'" name="'+prop+ " multiple=true \n"+
+        form.push('\t\t\t{{f.input type="select" label="'+prop+'" name="'+prop+ '" multiple=true \n'+
               'options='+inflection.pluralize(targetEntity)+' optionLabelPath="'+mapBy+'" optionValuePath="id" \n'+
               'includeBlank= "Please choose..." promptIsSelectable=false}}');
         break;
diff --git a/cloud/lambda-jsonapi-test.js b/cloud/lambda-jsonapi-test.js
index cc2dd34..ef6717f 100644
--- a/cloud/lambda-jsonapi-test.js
+++ b/cloud/lambda-jsonapi-test.js
@@ -3,7 +3,6 @@
 const AWS = require('aws-sdk');
 //const inflection = require('inflection');
 
-
 // BEGIN : To be removed from lambda deployment
 AWS.config.update({region:'us-east-1'});
 // END
@@ -82,10 +81,6 @@ function generateRowId(subid) {
           return createObject(data);
       }
   }
-  
-  const createRelationships= (obj) => {
-
-  }
 
   const handlingRelationships = (data) => {
     if (Array.isArray(data)) {
@@ -125,6 +120,7 @@ function generateRowId(subid) {
       } else {
           params.KeyConditionExpression = 'ObjectType = :objectType';
           params.ExpressionAttributeValues = { ':objectType': type };
+          params.Limit = MAX_OBJECTS;
           dbGet = (params) => { return dynamo.query(params).promise() };
           console.log('EmberDataServerless lambda GET multiple values with params: ', params);
       }
@@ -240,12 +236,10 @@ function generateRowId(subid) {
 
 const callback = (evt, msg) => {console.log(msg);};
 
-//putMethod(msgPut,{},callback);
-
 const msgGet = {
     "params": {
         "path": {
-            "type": "users"
+            "type": "authorities"
         },
         "querystring": {},
         "header": {}
diff --git a/cloud/lambda/lambda-jsonapi.js b/cloud/lambda/lambda-jsonapi.js
index 57264d0..0cd2f9a 100644
--- a/cloud/lambda/lambda-jsonapi.js
+++ b/cloud/lambda/lambda-jsonapi.js
@@ -73,10 +73,6 @@ function generateRowId(subid) {
           return createObject(data);
       }
   }
-  
-  const createRelationships= (obj) => {
-
-  }
 
   const handlingRelationships = (data) => {
     if (Array.isArray(data)) {
diff --git a/package.json b/package.json
index 7126e88..674c65e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "ember-aws-ehipster",
-  "version": "0.3.21",
+  "version": "0.3.23",
   "description": "Attempt to build a complete web application using serverless architecture on AWS",
   "keywords": [
     "ember-addon",
-- 
GitLab