refactor: rewrite useAdminSamlAuthProviderRoleMappings with RQ

This commit is contained in:
Rıdvan Akca
2024-03-15 19:03:54 +03:00
parent f0793992a6
commit 6a1350fd00
7 changed files with 48 additions and 58 deletions

View File

@@ -1,17 +0,0 @@
import SamlAuthProvider from '../../models/saml-auth-provider.ee.js';
const getSamlAuthProviderRoleMappings = async (_parent, params, context) => {
context.currentUser.can('read', 'SamlAuthProvider');
const samlAuthProvider = await SamlAuthProvider.query()
.findById(params.id)
.throwIfNotFound();
const roleMappings = await samlAuthProvider
.$relatedQuery('samlAuthProvidersRoleMappings')
.orderBy('remote_role_name', 'asc');
return roleMappings;
};
export default getSamlAuthProviderRoleMappings;