public IActionResult Delete(string id, string token, string phonenumber)
 {
     if (!UserAuthDAL.VerifyToken(phonenumber, token))
     {
         return(Unauthorized());
     }
     CustomerServicesDAL.DeleteService(id);
     return(Ok());
 }
Beispiel #2
0
 public IActionResult Get(string id, string phonenumber, string token)
 {
     if (!UserAuthDAL.VerifyToken(phonenumber, token))
     {
         return(Unauthorized());
     }
     CustomerServicesDAL.AddService(new CustomerService("Dwa", "dwa", "12", "dwa", "12", 0, 6, 6));
     return(Ok(CustomerServicesDAL.GetService(id)));
 }
Beispiel #3
0
 public IActionResult Post([FromBody] CustomerService customerService, [FromForm] string token)
 {
     if (customerService != null)
     {
         if (!UserAuthDAL.VerifyToken(customerService.phoneunumber, token))
         {
             return(Unauthorized());
         }
         CustomerServicesDAL.AddService(customerService);
         RubyDub.Util.Logger.LogCustomerService(customerService);
         return(Ok());
     }
     else
     {
         return(BadRequest());
     }
 }