|
@@ -251,16 +251,15 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
|
|
|
if (!json.TryGetProperty("stuListNo", out JsonElement _stuListNo)) return BadRequest();
|
|
|
- if (!json.TryGetProperty("userid", out JsonElement _userid)) return BadRequest();
|
|
|
+
|
|
|
json.TryGetProperty("school", out JsonElement _school);
|
|
|
- string userid = $"{_userid}";
|
|
|
string school = $"{_school}";
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
var queryNo = $"SELECT * FROM c where c.no ='{_stuListNo}'";
|
|
|
StuList stuList = null;
|
|
|
json.TryGetProperty("studentId", out JsonElement _studentId);
|
|
|
json.TryGetProperty("tmdId", out JsonElement _tmdId);
|
|
|
- if (!string.IsNullOrEmpty(school))
|
|
|
+ if (!string.IsNullOrEmpty(school)&&!string.IsNullOrEmpty($"{_studentId}") )
|
|
|
{
|
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: queryNo,
|
|
|
requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{school}") }))
|