Skip to content

Commit

Permalink
feat: added remove lock method to angular
Browse files Browse the repository at this point in the history
  • Loading branch information
Imran committed Nov 11, 2020
1 parent 5803f3e commit c18e631
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public interface IBackOfficeContentBlockerService
{
bool IsPageBlocked(string currentUserEmail, int pageId);
bool LockPage(string currentUserEmail, int pageId);
bool RemoveLock(string currentUserEmail);
}

public class BackOfficeContentBlockerService : IBackOfficeContentBlockerService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

var service = {
isPageBlocked: isPageBlocked,
lockPage: lockPage
lockPage: lockPage,
removeLock: removeLock
};

return service;
Expand All @@ -25,5 +26,9 @@
function lockPage() {
return $http.get(apiRoot + 'LockPage');
}

function removeLock() {
return $http.get(apiRoot + 'RemoveLock');
}
}
})();
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,13 @@ public IHttpActionResult LockPage(string currentUserEmail, int pageId)

return Json(pageLocked);
}

[HttpGet]
public IHttpActionResult RemoveLock(string currentUserEmail)
{
var lockRemoved = _contentBlockerService.RemoveLock(currentUserEmail);

return Json(lockRemoved);
}
}
}

0 comments on commit c18e631

Please sign in to comment.