|
@@ -39,11 +39,11 @@ namespace TEAMModelBI.Controllers.BICommon
|
|
|
public async Task<IActionResult> GetInfo(JsonElement jsonEmelent)
|
|
|
{
|
|
|
if (!jsonEmelent.TryGetProperty("id", out JsonElement id)) return BadRequest();
|
|
|
- jsonEmelent.TryGetProperty("type", out JsonElement type);
|
|
|
+ if (!jsonEmelent.TryGetProperty("type", out JsonElement type)) return BadRequest();
|
|
|
jsonEmelent.TryGetProperty("code", out JsonElement code);
|
|
|
var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
|
List<object> objs = new List<object>();
|
|
|
- if (!string.IsNullOrEmpty($"{type}"))
|
|
|
+ if (type.GetInt32() != 0)
|
|
|
{
|
|
|
await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", _containers[type.GetInt32()]).GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id='{id}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
|
|
|
{
|