예제 #1
0
        public IActionResult Post(int quantity = 1, string name = "", string location = "", string username = "", string password = "")
        {
            var auth = authRepository.AuthoriseUser(username, password);

            if (!auth.authorised)
            {
                return(BadRequest(auth.errorMessage));
            }

            storageRepository.AddItem(quantity, name, location);
            ////if (error) return BadRequest(errorText);
            //else return Ok("Item successfully added");
            return(Ok("Item added"));
        }