[HttpPost("EditByID")]                                                              //Chỉnh sửa khuyến mãi truyền vào id khuyến mãi và body model khuyến mãi
 public IActionResult EditByID(string id, [FromBody] Discount discount)
 {
     try{
         var           identity = HttpContext.User.Identity as ClaimsIdentity;       //khai báo biến danh tính của token
         IList <Claim> claim    = identity.Claims.ToList();                          //Danh sách các biến trong identity
         string        Email    = claim[1].Value;                                    //Email của token
         User          infoUser = new User();                                        //Khai bao biến thông tin người dùng
         if (infoUser.kiemtrathoigianlogin(DateTime.Parse(claim[0].Value)) == true)  //kiểm tra thời gian đăng nhập còn không
         {
             if (infoUser.checkAdmin(Email) == true)                                 //Kiểm tra có phải admin không
             {
                 Discount discount1 = new Discount();                                //Khai báo biến Model Discount
                 discount1.AddbyidToFireBase(id, discount);                          //Update data
                 return(Ok(new[] { "sửa thành công" }));
             }
             else
             {
                 return(Ok(new[] { "Bạn Không có quyền" }));
             }
         }
         else
         {
             return(Ok(new[] { "Bạn cần đăng nhập" }));
         }
     }
     catch {
         return(Ok(new[] { "Error" }));
     }
 }