Skip to content

Commit 912a2ba

Browse files
committed
Adding code that will suppor the external get of entitySelect lists. Validation needs to fixed.
1 parent 526d9bf commit 912a2ba

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

eFormAPI/eFormAPI/Controllers/EntitySelectController.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,35 @@ public OperationDataResult<EntityGroup> GetEntityGroup(string entityGroupUid)
127127
}
128128
}
129129

130+
[HttpGet]
131+
[AllowAnonymous]
132+
[Route("api/selectable-groups/get/{entityGroupUid}/token={token}")]
133+
public OperationDataResult<EntityGroup> GetEntityGroupExternally(string entityGroupUid, string token)
134+
{
135+
// Do some validation of the token. For now token is not valid
136+
bool tokenIsValid = false;
137+
if (tokenIsValid)
138+
{
139+
try
140+
{
141+
var core = _coreHelper.GetCore();
142+
143+
var entityGroup = core.EntityGroupRead(entityGroupUid);
144+
145+
return new OperationDataResult<EntityGroup>(true, entityGroup);
146+
}
147+
catch (Exception)
148+
{
149+
return new OperationDataResult<EntityGroup>(false,
150+
LocaleHelper.GetString("ErrorWhileObtainSelectableList"));
151+
}
152+
} else
153+
{
154+
return new OperationDataResult<EntityGroup>(false,
155+
LocaleHelper.GetString("ErrorWhileObtainSelectableList"));
156+
}
157+
}
158+
130159
[HttpGet]
131160
[Route("api/selectable-groups/dict/{entityGroupUid}")]
132161
public OperationDataResult<List<CommonDictionaryTextModel>> GetEntityGroupDictionary(string entityGroupUid)

0 commit comments

Comments
 (0)