public async Task <bool> DeleteJobPostFromWatchListAsync(string jobPostId, string companyId = null, string userId = null) { bool removed = false; // add the job to watch list DbAccessor db = new DbAccessor(); var jb = db.GetTableItems <WatchedJobs>().Where(x => x.JobPostId == jobPostId).FirstOrDefault(); if (jb != null) { // isn't in the list add it db.DeleteRecord <WatchedJobs>(jb); // TODO **** Push to api here - will need the postid/userid and company to uniquely identify for API removed = true; } return(removed); }
public async Task <bool> DeleteWatchListJobasync(string jobId) { // do api delete here using await // 1) check auth'd or a valid user // 2) push to api // TODO // now remove from the database itself so we dont hold it locally DbAccessor db = new DbAccessor(); var item = db.GetTableItems <WatchedJobs>().Where(x => x.JobPostId == jobId).FirstOrDefault(); if (item != null) { db.DeleteRecord <WatchedJobs>(item); } return(true); }