public static async Task <ConfessSender> Post(string guid, bool isComment, string confessguid) { try { string url = $"dislike/add?key={await Logic.GetKey()}&guid={guid}&isComment={isComment}&confess={confessguid}"; string content = await BaseClient.GetEntities(url); ConfessSender data = JsonConvert.DeserializeObject <ConfessSender>(content); return(data); } catch (Exception ex) { Crashes.TrackError(ex, Logic.GetErrorProperties(ex)); return(null); } }
public static async Task <ObservableCollection <ConfessLoader> > FetchAllConfess() { try { string url = $"confess/fetchall?key={await Logic.GetKey()}"; string content = await BaseClient.GetEntities(url); ObservableCollection <ConfessLoader> data = JsonConvert.DeserializeObject <ObservableCollection <ConfessLoader> >(content); return(data); } catch (Exception ex) { Crashes.TrackError(ex, Logic.GetErrorProperties(ex)); return(new ObservableCollection <ConfessLoader>()); } }
public static async Task <ConfessLoader> CreateComment(Comment comment, string confessGuid) { try { string url = $"comment/add"; CommentPoster poster = new CommentPoster() { Comment = comment, ConfessGuid = confessGuid, Key = await Logic.GetKey() }; string content = await BaseClient.PostEntities(url, JsonConvert.SerializeObject(poster)); ConfessLoader data = JsonConvert.DeserializeObject <ConfessLoader>(content); return(data); } catch (Exception ex) { Crashes.TrackError(ex, Logic.GetErrorProperties(ex)); return(null); } }
public static async Task <ConfessLoader> DeleteComment(string guid, string ConfessGuid) { try { string url = $"comment/delete?guid={guid}&confess={ConfessGuid}&key={await Logic.GetKey()}"; string content = await BaseClient.DeleteEntities(url); ConfessLoader data = JsonConvert.DeserializeObject <ConfessLoader>(content); return(data); } catch (Exception ex) { Crashes.TrackError(ex, Logic.GetErrorProperties(ex)); return(null); } }