Exemplo n.º 1
0
        public async Task <string> Post(string fileName, [FromBody] ConfigModel model)
        {
            //need to return an error at some point
            if (fileName == null || !fileName.EndsWith(".xml"))
            {
                return(null);
            }
            if (model == null)
            {
                return(null);
            }

            var content = await GetAndSetFileContent(fileName, model, false);

            var response = await _gitHubService.CreateContent(
                fileName,
                Models.Create.ContentFileModel.GetModel(User, content, $"Initializing phone to {model.name}.")
                );

            return(response);
        }