-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from clemthenem/bugFix/staff-page
Fixed bugs in the staff page and added improvments
- Loading branch information
Showing
7 changed files
with
67 additions
and
12 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
frontend-admin/src/app/components/mnoe-api/admin/current-user.svc.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Service to update the current user | ||
|
||
# We're not using angular-devise as the update functionality hasn't been | ||
# merged yet. | ||
# As we're using Devise + Her, we have custom routes to update the current user | ||
# It then makes more sense to have an extra service rather than have customised | ||
# fork of the upstream library | ||
|
||
|
||
@App.service 'MnoeCurrentUser', (MnoeApiSvc, $window, $state) -> | ||
_self = @ | ||
|
||
# Store the current_user promise | ||
# Only one call will be executed even if there is multiple callers at the same time | ||
userPromise = null | ||
|
||
# Save the current user in variable to be able to reference it directly | ||
@user = {} | ||
|
||
# Get the current user admmin role | ||
@getAdminRole = -> | ||
return userPromise if userPromise? | ||
userPromise = MnoeApiSvc.one('current_user').get().then( | ||
(response) -> | ||
adminRole = {admin_role: response.data.admin_role} | ||
angular.copy(adminRole, _self.user) | ||
response | ||
) | ||
|
||
return @ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters