public async Task DeleteFile(string commitMessage) { var apiUrl = $"api/delete/{AppState.owner}/{AppState.repoName}/{commitMessage}/{ListState.urlListPath}"; await HttpClient.DeleteAsync(apiUrl); ListState.PreviousFolder().GetAwaiter(); ListState.EditorClose(); ShowDone(); NotifyStateChanged(); }
public void UpdateFile(string commitMessage, string content) { var apiUrl = $"api/update/{AppState.owner}/{AppState.repoName}/{commitMessage}/{ListState.urlListPath}"; HttpClient.PostJsonAsync <string>(apiUrl, content); ListState.PreviousFolder().GetAwaiter(); ListState.EditorClose(); ShowDone(); NotifyStateChanged(); }
public void CreateFile(string commitMessage, string newContent, string newFileName, string newFileExtension) { var x = ListState.urlList; x.Add(newFileName + newFileExtension); ListState.urlListPath = String.Join("/", x); var apiUrl = $"api/create/{AppState.owner}/{AppState.repoName}/{commitMessage}/{ListState.urlListPath}"; HttpClient.PostJsonAsync <string>(apiUrl, newContent); ListState.EditorClose(); ListState.PreviousFolder().GetAwaiter(); ShowDone(); NotifyStateChanged(); }