public IActionResult Delete(string id, string token, string phonenumber)
 {
     if (!UserAuthDAL.VerifyToken(phonenumber, token))
     {
         return(Unauthorized());
     }
     CustomerServicesDAL.DeleteService(id);
     return(Ok());
 }
Ejemplo n.º 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)));
 }
        public IActionResult Get(string phonenumber, string token)
        {
            if (!UserAuthDAL.VerifyToken(phonenumber, token))
            {
                return(Unauthorized());
            }
            var transcations = TransactionsDAL.GetTransactions(phonenumber);

            return(Ok(transcations));
        }
Ejemplo n.º 4
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());
     }
 }