CrazyIter_Bin před 3 roky
rodič
revize
2d4ebf19bf

+ 4 - 4
TEAMModelOS.FunctionV4/HttpTrigger/IESHttpTrigger.cs

@@ -213,18 +213,18 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                     case "student":
                         try
                         {
-                            Student student = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<Student>(id, new PartitionKey($"Base-{school}"));
+                            Student student = await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReadItemAsync<Student>(id, new PartitionKey($"Base-{school}"));
                             student.loginInfos = new List<LoginInfo>() { new LoginInfo { expire = Expire, ip = ip, time = now } };
-                            await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Student>(student, student.id, new PartitionKey("Base"));
+                            await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReplaceItemAsync<Student>(student, student.id, new PartitionKey("Base"));
                         }
                         catch { }
                         break;
                     case "tmduser":
                         try
                         {
-                            TmdUser tmdUser = await cosmosClient.GetContainer("TEAMModelOS", "Student").ReadItemAsync<TmdUser>(id, new PartitionKey("Base"));
+                            TmdUser tmdUser = await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReadItemAsync<TmdUser>(id, new PartitionKey("Base"));
                             tmdUser.loginInfos = new List<LoginInfo>() { new LoginInfo { expire = Expire, ip = ip, time = now } };
-                            await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<TmdUser>(tmdUser, tmdUser.id, new PartitionKey("Base"));
+                            await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReplaceItemAsync<TmdUser>(tmdUser, tmdUser.id, new PartitionKey("Base"));
                         }
                         catch { }
                         break;