|
@@ -136,12 +136,12 @@ namespace TEAMModelOS.Controllers
|
|
|
schoolExtobj.status =sc.status;
|
|
|
schoolExtobj.time = sc.time;
|
|
|
schoolExtobj.picture = school.RootElement.GetProperty("picture");
|
|
|
- var areaId = school.RootElement.GetProperty("areaId");
|
|
|
+ //var areaId = school.RootElement.GetProperty("areaId"); //無areaId欄位對策
|
|
|
+ var areaId = (school.RootElement.TryGetProperty("areaId", out JsonElement areaIdJson) && !areaIdJson.ValueKind.Equals(JsonValueKind.Number)) ? areaIdJson.GetString() : null;
|
|
|
schoolExtobj.areaId = areaId;
|
|
|
Area area = null;
|
|
|
if (!string.IsNullOrEmpty($"{areaId}"))
|
|
|
{
|
|
|
-
|
|
|
try
|
|
|
{
|
|
|
area = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<Area>($"{areaId}", new PartitionKey("Base-Area"));
|